Minimal SCSS compiling with Gulp and Yarn

yarn
By admin on Mon, 02/27/2017 - 21:54
Tags

This is the minimal SASS compiling gulp I use for new themes.

create a new package.json file:

# npm init
$ yarn init
# npm install --save-dev gulp
$ yarnpkg add gulp
# npm i --save-dev gulp-sass
$ yarnpkg add gulp-sass
/** 
 * file: gulpfile.js  
 * @file  
 * Gulp file to compile the SASS files into CSS.  */

 'use strict';

  var gulp = require('gulp');
  var sass = require('gulp-sass');

  gulp.task('sass', function () {      
      gulp.src('./src/sass/**/*.scss')        
        .pipe(sass().on('error', sass.logError))        
        .pipe(gulp.dest('css'));
    });

  gulp.task('default', function () {      
      gulp.watch('./src/sass/**/*.scss', ['sass']);
    });

then just execute

$ gulp