Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
LESS import tree; using
// usage: node less-import-tree.js myfile.less
// change dirPath to whatever you need
var args = process.argv.slice(2);
var path = require('path');
var progeny = require('progeny');
var dirPath = 'resources/less';
var fileName = args[0];
var filePath = path.join(dirPath, fileName);
extension: 'less',
regexp: /^\s*@import\s*(?:\(\w+\)\s*)?['"]([^'"]+)['"]/,
debug: true
})(filePath, function(error, result) {
// console.log(error || result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.