npm install node-sass-glob-once
This is a module that modifies imports in exactly two ways:
Requires Node >= 5.0.
node-sass-glob-once is a node-sass importer.
You can use Sass source like this:
@import "reset";
@import "components/**/*.scss";
:root {
font-family: Arial;
}
const sass = require("node-sass");
const globOnce = require("node-sass-glob-once");
sass.render({
file: "main.scss",
{
importer: [globOnce]
}
});
const gulp = require("gulp");
const sass = require("gulp-sass");
const globOnce = require("node-sass-glob-once");
gulp.task("styles", () => {
return gulp.src("main.scss")
.pipe(sass({
importer: [globOnce]
}))
.pipe(gulp.dest("css/bundle.css"));
});