Package Exports
- node-sass-glob-importer
- node-sass-glob-importer/dist/GlobImporter
- node-sass-glob-importer/dist/GlobImporter.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 (node-sass-glob-importer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-sass-glob-importer
Custom node-sass importer to allow you to use glob syntax in imports.
Globbing allows pattern matching operators to be used to match multiple files at once.
// Import all files inside the `scss` directory and subdirectories.
@import: 'scss/**/*.scss';Usage
var sass = require('node-sass');
var glopImporter = require('node-sass-glob-importer');
sass.render({
...
importer: glopImporter()
...
});Options
sass.render({
...
importer: globImporter({
includePaths: [process.cwd()]
})
...
});CLI
node-sass --importer node_modules/node-sass-glob-importer/dist/cli.js -o dist src/index.scssUpgrade from 2.x.x to 3.x.x
Version 3.x.x does not return a node-sass custom importer function directly. Instead a function which can take a optional parameter for configuration is returned. When the function is executed, it returns a node-sass custom importer function.
sass.render({
...
// Old
importer: globImporter
// New
importer: globImporter()
...
});If you want to use the node-sass-glob-importer in combination with the node-sass CLI, you now have to specify the path to the node-sass-glob-importer CLI script.
# Old
node-sass --importer node_modules/node-sass-glob-importer -o dist src/index.scss
# New
node-sass --importer node_modules/node-sass-glob-importer/dist/cli.js -o dist src/index.scssnode-sass-magic-importer
This module is part of the node-sass-magic-importer module.
About
Author
Markus Oberlehner
Twitter: https://twitter.com/MaOberlehner
PayPal.me: https://paypal.me/maoberlehner
License
MIT