1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | module.exports = function(gulp, $, conf, browserSync) {
|
8 | gulp.task('scripts',function() {
|
9 | var compress = conf.build.compress !== true ? !!conf.build.compress.js : true;
|
10 | return gulp.src(conf.parsePwd(conf.scriptFiles), { base: conf.parsePwd(conf.app) })
|
11 | .pipe($.if(!conf.isProduction, $.sourcemaps.init()))
|
12 | .pipe($.if(conf.isProduction && compress, $.uglify()))
|
13 | .on('error', conf.errorHandler('Uglify'))
|
14 | .pipe($.if(!conf.isProduction, $.sourcemaps.write()))
|
15 | .pipe(gulp.dest(conf.parsePwd(conf.tmp)))
|
16 | .pipe(browserSync.stream());
|
17 | });
|
18 | }
|