meshviewer/gulp/tasks/javascript.js
2018-01-05 22:59:34 +01:00

14 lines
553 B
JavaScript

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))
.on('error', function () {
this.emit('end');
})
.pipe(env.production(plugins.uglify({ output: { comments: 'all' } })))
.pipe(env.development(plugins.sourcemaps.write('.', { addComment: true })))
.pipe(gulp.dest(config.build));
};
};