-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
33 lines (28 loc) · 872 Bytes
/
gulpfile.js
File metadata and controls
33 lines (28 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var del = require('del');
var paths = {
scripts: ['javascript/*.js'],
css: ['css/*.css']
};
gulp.task('clean', function() {
return del(['javascript/dist']);
});
// Concat & Minify JS
gulp.task('minify', ['clean'], function(){
return gulp.src('javascript/*.js')
.pipe(concat('pe-utils.js'))
.pipe(gulp.dest('javascript/dist'))
.pipe(rename('pe-utils.min.js'))
.pipe(uglify())
.pipe(gulp.dest('javascript/dist'));
});
// Rerun the task when a file changes
gulp.task('watch', function() {
gulp.watch(paths.scripts, ['minify']);
gulp.watch(paths.css, ['minify']);
});
// The default task (called when you run `gulp` from cli)
gulp.task('default', ['watch', 'minify']);