Last active
April 12, 2016 18:09
-
-
Save joshualeduc/2bbe46029a1008e9a4d6d7bc77656aa9 to your computer and use it in GitHub Desktop.
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 concat = require('gulp-concat'); | |
| var uglify = require('gulp-uglify') | |
| var uglifycss = require('gulp-uglifycss'); | |
| var ngAnnotate = require('gulp-ng-annotate'); | |
| var server = require('gulp-webserver'); | |
| var htmlmin = require('gulp-htmlmin'); | |
| var watcher = gulp.watch(['./src/js/**/*.js', './src/styles/*.scss', './src/views/**/**/*.html', './src/*.html'], ['default']); | |
| watcher.on('change', function( event ) { | |
| console.log('File ' + event.path + ' was ' + event.type + ' at ' + new Date() + ' , running tasks...'); | |
| }); | |
| gulp.task('styles', function(){ | |
| gulp.src('./src/styles/*.css') | |
| .pipe(uglifyCss()) | |
| .pipe(concat('styles.css')) | |
| .pipe(gulp.dest('./public/')); | |
| }); | |
| gulp.task('javascript', function() { | |
| gulp.src('./src/js/**/*.js') | |
| .pipe(ngAnnotate()) | |
| .pipe(uglify()) | |
| .pipe(concat('all.min.js')) | |
| .pipe(gulp.dest('./public/app.min.js')) | |
| }); | |
| gulp.task('html', function() { | |
| gulp.src('./src/views/**/*.html') | |
| .pipe(htmlmin({collapseWhitespace: true})) | |
| .pipe(gulp.dest('./public/views')) | |
| }); | |
| gulp.task('index', function() { | |
| gulp.src('./src/*.html') | |
| .pipe(htmlmin({collapseWhitespace: true})) | |
| .pipe(gulp.dest('./public')) | |
| }); | |
| gulp.task('default', ['style', 'javascript', 'html', 'index']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment