O'Reilly logo

Hands-On Full Stack Web Development with Aurelia by Erikson Haziz Murrugarra Sifuentes, Diego Jose Arguelles Rojas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

JavaScript task

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required