Package Exports
- detective-scss
- detective-scss/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (detective-scss) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
detective-scss
Find the dependencies of an scss file
npm install detective-scssNote: This is specific to the .scss style syntax of the Sass preprocessor. For Sass support, please see node-detective-sass.
It's the SASS counterpart to detective, detective-amd, and detective-es6.
- The AST is generated using the gonzales-pe parser.
Usage
const fs = require('fs');
const detective = require('detective-scss');
const content = fs.readFileSync('styles.scss', 'utf8');
// list of imported file names (ex: '_foo.scss', '_foo', etc)
const dependencies = detective(content);
// or to also detect any url() references to images, fonts, etc.
const allDependencies = detective(content, { url: true });Options
url(optional): (Boolean) also detect anyurl()references to images, fonts, etc.
Related
- node-sass-lookup if you want to map a sass/scss dependency to a file on your filesystem.
- node-precinct if you want to also support finding dependencies for JavaScript and other languages.