Created
April 1, 2017 23:05
-
-
Save thybzi/41ba2209ba8ba1acfaaac259190c4456 to your computer and use it in GitHub Desktop.
LESS import tree; using https://github.com/es128/progeny
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); | |
progeny({ | |
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