sass-glob-importer

1.0.1 • Public • Published

sass-glob-importer

Simple importer for node-sass to allow importing Sass files using glob patterns

@import "settings/*.scss";
@import "components/*.scss";

The files will always be sorted alphabetically when imported.

How-to

install

npm install sass-glob-importer --save-dev

use the importer with node-sass >= v3.0.0

var sass = require('node-sass');
var globImporter = require('sass-glob-importer');
 
sass.render({
  file: './source/css/app.scss',
  importer: globImporter()
}, cb);

use the importer with gulp-sass

var gulp = require('gulp');
var sass = require('gulp-sass');
var globImporter = require('sass-glob-importer');
 
gulp.task('style', function() {
  return gulp.src('./source/css/app.scss')
    .pipe(sass({ importer: globImporter() }))
    .pipe(gulp.dest('./public/css'));
});

Tests

Use npm test to run the tests.

Issues

If you discover a bug, please raise an issue on Github. https://github.com/lucasmotta/sass-glob-importer/issues

Contributors

The source code and the test are written in ES6 (ECMAScript 2015).
Babel is being used to compile to ES5 before the package is published to npm.

Package Sidebar

Install

npm i sass-glob-importer

Weekly Downloads

583

Version

1.0.1

License

MIT

Last publish

Collaborators

  • lucasmotta