Created
October 10, 2014 13:02
-
-
Save jdcauley/dc936d90dfcd87375c26 to your computer and use it in GitHub Desktop.
Sass Gulpfile.js
This file contains hidden or 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
var gulp = require('gulp'); | |
var compass = require('gulp-compass'); | |
var watch = require('gulp-watch'); | |
var minifyCSS = require('gulp-minify-css'); | |
var jshint = require('gulp-jshint'); | |
var stylish = require('jshint-stylish'); | |
var uglify = require('gulp-uglify'); | |
gulp.task('scss', function(){ | |
console.log('running scss'); | |
gulp.src('scss/custom.scss') | |
.pipe(compass({ | |
config_file: 'config.rb', | |
css: 'css', | |
sass: 'scss' | |
})) | |
.pipe(gulp.dest('assets/css')); | |
}); | |
gulp.task('js', function(){ | |
gulp.src('js/*.js') | |
.pipe(jshint()) | |
.pipe(jshint.reporter(stylish)) | |
.pipe(gulp.dest('assets/js')) | |
}); | |
gulp.task('minify-js', function(){ | |
gulp.src('js/*.js') | |
.pipe(jshint()) | |
.pipe(jshint.reporter(stylish)) | |
.pipe(uglify()) | |
.pipe(gulp.dest('assets/js')) | |
}); | |
gulp.task('minify-css', function(){ | |
gulp.src('scss/custom.scss') | |
.pipe(compass({ | |
config_file: 'config.rb', | |
css: 'css', | |
sass: 'scss' | |
})) | |
.pipe(minifyCSS()) | |
.pipe(gulp.dest('assets/css')); | |
}); | |
gulp.task('default', function(){ | |
gulp.watch('scss/*.scss', ['scss']); | |
gulp.watch('js/*.js', ['js']); | |
}); | |
gulp.task('production', function(){ | |
gulp.watch('scss/*.scss', ['minify-css']); | |
gulp.watch('js/*.js', ['minify-js']); | |
}); | |
This file contains hidden or 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": "yourpackage", | |
"version": "1.0.0", | |
"description": "Duke Sanford School Site", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"gulp": "^3.8.8" | |
}, | |
"devDependencies": { | |
"gulp-compass": "^1.3.1", | |
"gulp-uglify": "^1.0.1", | |
"gulp-watch": "^1.0.7", | |
"gulp-minify-css": "^0.3.10", | |
"gulp-jshint": "^1.8.5", | |
"jshint-stylish": "^1.0.0", | |
"gulp-sass": "^1.0.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment