Sometimes it's useful to get a list of all
@imports for a given
.less file, especially if you want to watch those files for changes in your
grunt build steps. We can easily achieve this using the LESS parser itself!
Disclaimer... this relies on internal implementation details of the LESS.js library and as such could break at any time. That being said, this code should work on all LESS.js versions stretching right back to
Take a look at the official repo for more information on how to use this in your work flow