Created
August 26, 2014 14:01
-
-
Save iCodeForBananas/49b89049f6502c948781 to your computer and use it in GitHub Desktop.
AngualrJS Gulpfile
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
// | |
// Module Dependencies | |
// ================================================================== | |
var gulp = require('gulp'), | |
concat = require('gulp-concat'), | |
uglify = require('gulp-uglify'), | |
plumber = require('gulp-plumber'), | |
sass = require('gulp-sass'); | |
// | |
// Configuration | |
// ================================================================== | |
var bowerDir = "public/components"; | |
// | |
// Tasks | |
// ================================================================== | |
gulp.task('default', [ | |
'scripts', | |
'html', | |
'vendor' | |
]); | |
// | |
// App | |
// ================================================================== | |
gulp.task('watch', function() { | |
gulp.watch('app/assets/app/**/*.js', ['scripts']); | |
gulp.watch('app/assets/app/**/*.html', ['html']); | |
gulp.watch('app/assets/styles/**/*.scss', ['styles']); | |
}); | |
gulp.task('scripts', function() { | |
return gulp.src('app/assets/app/**/*.js') | |
.pipe(plumber()) | |
.pipe(concat('app.js')) | |
.pipe(gulp.dest('public/dist')); | |
}); | |
gulp.task('html', function() { | |
return gulp.src('app/assets/app/**/*.html') | |
.pipe(plumber()) | |
.pipe(gulp.dest('public/dist')); | |
}); | |
gulp.task('styles', function() { | |
return gulp.src('app/assets/styles/main.scss') | |
.pipe(plumber()) | |
.pipe(sass()) | |
.pipe(gulp.dest('public/styles')); | |
}); | |
gulp.task('vendor', function() { | |
return gulp.src([ | |
bowerDir + '/lodash/dist/lodash.min.js', | |
bowerDir + '/momentjs/min/moment.min.js', | |
bowerDir + '/jquery/dist/jquery.min.js', | |
bowerDir + '/firebase/firebase.js', | |
bowerDir + '/bootstrap/dist/js/bootstrap.min.js', | |
bowerDir + '/angular/angular.js', | |
bowerDir + '/angularfire/dist/angularfire.min.js', | |
bowerDir + '/angular-ui-router/release/angular-ui-router.min.js', | |
bowerDir + '/angular-loading-bar/build/loading-bar.min.js', | |
bowerDir + '/angularfire/dist/angularfire.min.js', | |
bowerDir + '/angular-loading-bar/build/loading-bar.min.js' | |
]) | |
.pipe(plumber()) | |
.pipe(concat('vendor.js')) | |
.pipe(uglify()) | |
.pipe(gulp.dest('public/dist')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment