Answer the question
In order to leave comments, you need to log in
How to write a task correctly: sass + sourcemaps + many subfolders?
Hello!
Task now looks like this:
gulp.task('sass', function () {
// bootstrap compilation
gulp.src('./sass/bootstrap.scss')
.pipe(sourcemaps.init())
.pipe(sass())
.pipe(sourcemaps.write('.', {includeContent: true, sourceRoot: '/sass'}))
.pipe(gulp.dest('./assets/global/plugins/bootstrap/css/'))
// global theme stylesheet compilation
gulp.src('./sass/global/*.scss')
.pipe(sourcemaps.init())
.pipe(sass())
.pipe(sourcemaps.write('.', {includeContent: true, sourceRoot: '/sass/global'}))
.pipe(gulp.dest('./assets/global/css'))
gulp.src('./sass/apps/*.scss')
.pipe(sourcemaps.init())
.pipe(sass())
.pipe(sourcemaps.write('.', {includeContent: true, sourceRoot: '/sass/apps'}))
.pipe(gulp.dest('./assets/apps/css'))
gulp.src('./sass/pages/*.scss')
.pipe(sourcemaps.init())
.pipe(sass())
.pipe(sourcemaps.write('.', {includeContent: true, sourceRoot: '/sass/pages'}))
.pipe(gulp.dest('./assets/pages/css'))
// theme layouts compilation
gulp.src('./sass/layouts/layout4/*.scss')
.pipe(sourcemaps.init())
.pipe(sass())
.pipe(sourcemaps.write('.', {includeContent: true, sourceRoot: '/sass/layouts/layout4'}))
.pipe(gulp.dest('./assets/layouts/layout4/css'))
gulp.src('./sass/layouts/layout4/themes/*.scss')
.pipe(sourcemaps.init())
.pipe(sass())
.pipe(sourcemaps.write('.', {includeContent: true, sourceRoot: '/sass/layouts/layout4/themes'}))
.pipe(gulp.dest('./assets/layouts/layout4/css/themes'))
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question