-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
34 lines (30 loc) · 995 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
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var sourcemaps = require('gulp-sourcemaps');
var watch = require('gulp-watch');
gulp.task('javascript', function() {
gulp.src('src/js/**/*.js')
.pipe(sourcemaps.init({loadMaps: true}))
.pipe(concat('app.min.js'))
/*.pipe(uglify())*/
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('build'));
});
gulp.task('vendors', function() {
gulp.src('src/vendors/**/*.js')
.pipe(sourcemaps.init({loadMaps: true}))
.pipe(concat('vendors.js'))
/*.pipe(uglify())*/
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('build'));
});
gulp.task('watch', function() {
watch('src/js/**/*.js', function() {
gulp.start('javascript');
});
watch('src/vendors/**/*.js', function() {
gulp.start('vendors');
});
});
gulp.task('default', ['javascript', 'vendors', 'watch'], function(){});