Skip to content

Instantly share code, notes, and snippets.

@jasonsilberman
Created September 4, 2014 01:56
Show Gist options
  • Save jasonsilberman/56f2b6f2dd61047c431a to your computer and use it in GitHub Desktop.
Save jasonsilberman/56f2b6f2dd61047c431a to your computer and use it in GitHub Desktop.
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
sass = require('gulp-sass');
gulp.task('compress-js', function () {
gulp.src('assets/js/*.js')
.pipe(uglify())
.pipe(gulp.dest('build/js'));
});
gulp.task('concat', function () {
gulp.src(['assets/css/reset.css', 'assets/sass/_mixins.scss', 'assets/sass/_vars.scss', 'assets/sass/_custom-reset.scss', 'assets/sass/_custom-mixins.scss', 'assets/sass/dc.scss'])
.pipe(concat('app.scss'))
.pipe(gulp.dest('assets/concat'));
});
gulp.task('sass', function () {
gulp.src('assets/concat/app.scss')
.pipe(sass({
outputStyle: 'compressed'
}))
.pipe(gulp.dest('build/css'));
});
gulp.task('watch', function () {
gulp.watch('assets/sass/*.scss', ['concat', 'sass']);
gulp.watch('assets/js/*.js', ['compress-js']);
});
gulp.task('default', ['compress-js', 'concat', 'sass', 'watch']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment