Created
September 19, 2015 13:59
-
-
Save xtepwxly/b1c4ccd9ea32deab7066 to your computer and use it in GitHub Desktop.
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'), | |
sass = require('gulp-sass'), | |
uglify = require('gulp-uglify'), | |
concat = require('gulp-concat'); | |
var bowerPath = 'private/bower_components/'; | |
gulp.task('default', ['js-minify', 'js-minify:watch', 'sass', 'sass:watch', 'css']); | |
gulp.task('js', function() { | |
gulp.src([ | |
bowerPath + 'angular/angular.min.js', | |
bowerPath + 'bootstrap/dist/js/bootstrap.min.js', | |
bowerPath + 'jquery/dist/jquery.min.js' | |
]) | |
.pipe(gulp.dest('public/js')); | |
}); | |
gulp.task('js-minify', function() { | |
gulp.src('private/scripts/*.js') | |
.pipe(concat('scripts.min.js')) | |
.pipe(uglify()) | |
.pipe(gulp.dest('public/js')); | |
}); | |
gulp.task('js-minify:watch', function() { | |
gulp.watch('private/scripts/scripts.js', ['js-minify']); | |
}); | |
gulp.task('css', function() { | |
gulp.src([ | |
bowerPath + 'bootstrap/dist/css/bootstrap.min.css' | |
]) | |
.pipe(gulp.dest('public/css')); | |
}); | |
gulp.task('sass', function() { | |
gulp.src('private/scss/*.scss') | |
.pipe(sass.sync().on('error', sass.logError)) | |
.pipe(gulp.dest('public/css')); | |
}); | |
gulp.task('sass:watch', function() { | |
gulp.watch('private/scss/*.scss', ['sass']); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment