Skip to content

Instantly share code, notes, and snippets.

@tarex
Created October 14, 2014 23:34
Show Gist options
  • Save tarex/bac25336627304cb7b0b to your computer and use it in GitHub Desktop.
Save tarex/bac25336627304cb7b0b to your computer and use it in GitHub Desktop.
My gulp file
var gulp = require('gulp'),
plug = require("gulp-load-plugins")({lazy:false})
wiredep = require('wiredep').stream;
gulp.task('bower', function () {
gulp.src('app/index.html')
.pipe(wiredep())
.pipe(gulp.dest('app/'));
});
gulp.task('build', function() {
gulp.src('app/index.html')
.pipe(plug.usemin({
css: [ plug.minifyCss(),'concat'],
css1: [ plug.autoprefixer(),plug.minifyCss(),'concat'],
js: [plug.uglify()],
js1: [plug.uglify()] // will add rev() if needed
}))
.pipe(gulp.dest('dist/'));
});
gulp.task('watch', function() {
gulp.watch('app/bower_components/**/*', ['bower']);
gulp.watch(['app/index.html','app/js/**/*.js','app/css/**/*.css'], ['build']);
});
gulp.task('default', ['watch', 'bower', 'build']);
{
"devDependencies": {
"gulp": "^3.8.7",
"gulp-angular-templatecache": "^1.3.0",
"gulp-autoprefixer": "0.0.10",
"gulp-load-plugins": "^0.6.0",
"gulp-minify-css": "^0.3.7",
"gulp-rev": "^1.1.0",
"gulp-uglify": "^1.0.0",
"gulp-usemin": "^0.3.8",
"gulp-util": "^3.0.1",
"gulp-watch": "^0.7.0",
"wiredep": "^1.8.5"
},
"dependencies": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment