Answer the question
In order to leave comments, you need to log in
How to write a task for Gulp so that the file is collected in one?
I am compiling Gulp for a project.
Zaparka was created on the simplest place.
gulp.task('sass', function () {
return gulp.src('assets/sass/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('assets/css'));
});
Answer the question
In order to leave comments, you need to log in
You make some app.sass file, where
@import 'first.sass';
@import '../second.sass';
...
var concat = require('gulp-concat');
var minifyCSS = require('gulp-minify-css');
var SCSSfiles = ['assets/sass/**/*.scss', '!assets/sass/reset.scss', '!assets/sass/all.scss'];
var resetCSS = ['assets/sass/reset.scss'];
var allCSS = ['assets/sass/all.scss'];
var resetFirst = resetCSS.concat(allCSS);
var concatFiles = resetFirst.concat(SCSSfiles);
gulp.task('sass', function() {
return gulp.src(concatFiles)
.pipe(concat('styles.min.scss'))
.pipe(sass().on('error', sass.logError))
.pipe(minifyCSS())
.pipe(gulp.dest('assets/css'));
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question