Last active
January 30, 2016 21:49
-
-
Save waldofe/27febf1697aee0cf6dd7 to your computer and use it in GitHub Desktop.
Pre-compiling SCSS files using Gulp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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