Allows you to use glob syntax in imports (i.e. @import "dir/*.sass"
). Use as a custom importer for node-sass.
var nodeSassGlobbing = require('node-sass-globbing');
gulp.task('sass', function () {
return gulp.src('styles/**/*.{scss,sass}')
.pipe(sass({importer: nodeSassGlobbing()}).on('error', sass.logError)))
.pipe(gulp.dest('css'))
}));
Then you can import globs!
@import "variables/**/*.scss";
@import "mixins/**/*.scss";
It also works with sourcemaps:
var nodeSassGlobbing = require('node-sass-globbing'),
sourcemaps = require('gulp-sourcemaps');
gulp.task('sass', function () {
var opts = {
sync: true, // this will make the glob to perform a synchronous search
}
return gulp.src('styles/**/*.{scss,sass}')
.pipe(sourcemaps.init())
.pipe(sass({importer: nodeSassGlobbing(opts)}).on('error', sass.logError)))
.pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest('css'))
}));
npm test
You can also run the tests through docker. Initially the repository would need to install the dependencies, you can do that with:
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/app -w /usr/src/app node:4 npm install
After dependencies are installed run the tests with:
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/app -w /usr/src/app node:4 npm test
Available under the MIT License.