June 2018
Intermediate to advanced
348 pages
8h 19m
English
We will configure an automated task to transform our created SCSS files into CSS. This code can be implemented in any web project (with gulp dependencies preconfigured, of course):
$ npm install gulp-sass --save-dev
gulp-sass is a customized plugin for gulp to work with SASS files.
After importing the npm modules into our project, let's reference them into our gulpfile:
var gulp = require('gulp'); var sass = require('gulp-sass');
Then, we need to create a new task. Let's call it process-styles:
// SCSS processing gulp.task('process-styles', function() {gulp.src('sass/**/*.scss') .pipe(sass().on('error', sass.logError)) .pipe(gulp.dest('./css/'));});
Note that we use the pipe() method to call any extra plugins between the ...
Read now
Unlock full access