2017-03-22 22:13:37 +00:00
|
|
|
module.exports = function (gulp, plugins, config, env) {
|
|
|
|
return function javascript() {
|
|
|
|
return gulp.src('app.js')
|
|
|
|
.pipe(env.development(plugins.sourcemaps.init()))
|
|
|
|
.pipe(plugins.requirejsOptimize(env.production() ? config.requireJs.prod : config.requireJs.dev))
|
2018-01-05 21:59:34 +00:00
|
|
|
.on('error', function () {
|
|
|
|
this.emit('end');
|
|
|
|
})
|
2017-05-24 14:15:50 +00:00
|
|
|
.pipe(env.production(plugins.uglify({ output: { comments: 'all' } })))
|
2017-03-22 22:13:37 +00:00
|
|
|
.pipe(env.development(plugins.sourcemaps.write('.', { addComment: true })))
|
|
|
|
.pipe(gulp.dest(config.build));
|
|
|
|
};
|
|
|
|
};
|