-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Description
Here is how to use gulp-inject to populate a file with @import rows. That can be done to have a import.scss file to use with gulp-sass.
The benefit against gulp-glob-sass and gulp-concat is that Scss mixins can be used without any trouble and without any hacks.
The only downside would be that you need to run gulp imports after you have created a new scss file (not when you update them).
function import_scss() {
return gulp
.src('assets/css/imports.scss')
.pipe(
inject(
gulp.src([ 'custom/components/global/reset.scss', 'custom/components/**/*.scss' ], {
read: false
}),
{
starttag: '/* inject:imports */',
endtag: '/* endinject */',
transform: function(filepath) {
return '@import ".' + filepath + '";';
}
}
)
)
.pipe(gulp.dest('assets/css'));
}
exports.imports = import_scss;To run do it like this:
gulp imports
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels