Skip to content

Instantly share code, notes, and snippets.

@waldofe
Last active January 30, 2016 21:49
Show Gist options
  • Save waldofe/27febf1697aee0cf6dd7 to your computer and use it in GitHub Desktop.
Save waldofe/27febf1697aee0cf6dd7 to your computer and use it in GitHub Desktop.
Pre-compiling SCSS files using Gulp
'use strict';
// Requiring dependencies
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
// Naming paths and files
var scssFilesPath = './assets/stylesheets/**/*.scss';
var outputPath = './assets/stylesheets'
var outputFileName = 'master.css'
// Sass task
gulp.task('sass', function () {
return gulp.src(scssFilesPath)
.pipe(concat(outputFileName))
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(outputPath));
});
// Sass watch task
gulp.task('sass:watch', function () {
gulp.watch(scssFiles, ['sass']);
});
// Single task call on `gulp` call
gulp.task('default', ['sass:watch']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment