Skip to content

Instantly share code, notes, and snippets.

@pedrorocha-net
Created July 15, 2016 16:53
Show Gist options
  • Save pedrorocha-net/8a3f1d455568d8f95fbdf57fc80ce44e to your computer and use it in GitHub Desktop.
Save pedrorocha-net/8a3f1d455568d8f95fbdf57fc80ce44e to your computer and use it in GitHub Desktop.
Setup for SASS with Gulp
gulp = require 'gulp'
$ = require('gulp-load-plugins')({
pattern: ['gulp-*', 'run-sequence']
});
sources =
sass: 'docroot/sites/all/themes/nylottery/assets/scss/**/*.scss'
destinations =
css: 'docroot/sites/all/themes/nylottery/assets/css'
###
Compile SASS files
###
gulp.task 'style', ->
gulp.src(sources.sass)
.pipe($.plumber())
.pipe($.sass({compass: true, style: 'expanded'}))
.on('error', $.sass.logError)
# .pipe($.minifyCss())
.pipe(gulp.dest(destinations.css))
###
Keep watching files for changes to update them automatically
###
gulp.task 'watch', ->
gulp.watch sources.sass, ['style']
###
Run tasks to deploy new version
###
gulp.task 'build', [
'style'
]
###
Default command to run when calling just "gulp"
###
gulp.task 'default', ['watch']
{
"name": "sqknyl",
"version": "1.0.0",
"author": "Pedro Rocha <[email protected]>",
"devDependencies": {
"coffee-script": "^1.8.0",
"gulp": "^3.8.10",
"gulp-compass": "^2.0.3",
"gulp-load-plugins": "^0.8.0",
"gulp-sass": "^2.0.4",
"gulp-plumber": "^1.0.1",
"run-sequence": "^1.0.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment