问题
My tasks are as follows:
gulp.task('sass', function () {
gulp.src(paths.webroot + '/css/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(paths.webroot + '/css'));
});
gulp.task('sass:watch', function () {
gulp.watch(paths.webroot + 'css/**/*.scss', ['sass']);
});
My folder structure:
css
libs
_partial1.scss
_partial2.scss
main.scss
How can I ignore all files with underscore or go after only top level files in css
(ignoring libs
)
回答1:
To go after only top level files in css/
and ignore css/libs
, do:
gulp.src(paths.webroot + '/css/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(paths.webroot + '/css'));
});
I'm guessing you're already importing the partials in your main.scss
or some other top level file.
来源:https://stackoverflow.com/questions/32657255/gulp-doesnt-ignore-sass-partials-with-underscore