-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgulpfile.js
39 lines (33 loc) · 936 Bytes
/
gulpfile.js
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
34
35
36
37
38
39
var gulp = require('gulp');
var concat = require('gulp-concat');
var minify = require('gulp-minify');
gulp.task('default', ['watch']);
gulp.task('build-js-dev', function () {
return gulp.src([
'node_modules/jquery/dist/jquery.min.js',
'node_modules/requirejs/require.js',
'js/app/**/*.js',
'js/app-init.js'
])
.pipe(concat('build.js'))
.pipe(gulp.dest('build/js'));
});
gulp.task('build-js-prod', function () {
return gulp.src([
'node_modules/jquery/dist/jquery.min.js',
'node_modules/requirejs/require.js',
'js/app/**/*.js',
'js/app-init.js'
])
.pipe(concat('build.js'))
.pipe(minify({
ext:{
src:'-debug.js',
min:'.min.js'
}
}))
.pipe(gulp.dest('build/js'));
});
gulp.task('watch', function(){
gulp.watch('js/**/*.js', ['build-js-dev']);
});