Find the dependencies of a less file
npm install @dependents/detective-lessNote: This is specific to the .less style syntax.
It's the LESS counterpart to detective, detective-amd, and detective-es6.
- The AST is generated using the gonzales-pe parser.
constfs=require('fs');constdetective=require('@dependents/detective-less');constcontent=fs.readFileSync('styles.less','utf8');// list of imported file names (ex: 'foo.less', 'foo', etc)constdependencies=detective(content);// or to also detect any url() references to images, fonts, etc.constallDependencies=detective(content,{url: true});url(optional): (Boolean) also detect anyurl()references to images, fonts, etc.