Skip to content

Extension for gulp-sass and node-sass to allow you to do import "dir/**/*.sass" or "dir/**/*.scss". Inspired by https://github.com/chriseppstein/sass-globbing and forked from https://github.com/britco/node-sass-globbing

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

fffunction/node-sass-globbing

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-sass-globbing

Build Status Dependency Status npm

Allows you to use glob syntax in imports (i.e. @import "dir/*.sass"). Use as a custom importer for node-sass.

Example

gulpfile.js
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!

foo.sass
@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 () {
	return gulp.src('styles/**/*.{scss,sass}')
			.pipe(sourcemaps.init())
			.pipe(sass({importer: nodeSassGlobbing}).on('error', sass.logError)))
			.pipe(sourcemaps.write('./maps'))
			.pipe(gulp.dest('css'))			
}));

Tests

npm test

Tests (Docker)

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

License

Available under the MIT License.

About

Extension for gulp-sass and node-sass to allow you to do import "dir/**/*.sass" or "dir/**/*.scss". Inspired by https://github.com/chriseppstein/sass-globbing and forked from https://github.com/britco/node-sass-globbing

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%