Created
July 15, 2016 16:53
-
-
Save pedrorocha-net/8a3f1d455568d8f95fbdf57fc80ce44e to your computer and use it in GitHub Desktop.
Setup for SASS with 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
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'] |
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
{ | |
"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