Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function scriptsTask () {
const entryPoint = path.join(config.root.src, task.path, task.entry)
browserify(entryPoint, addons.browserify)
.transform(babelify, addons.babelify)
.bundle()
.on('error', e => util.log(e))
.pipe(source(task.entry))
.pipe(buffer())
.pipe(stripDebug())
.pipe(gulp.dest(paths.dest))
.pipe(uglify())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest(paths.dest))
}
return () => webpackStream(config)
.pipe(jsOnly)
.pipe(header(BANNER))
.pipe(rename({basename: basename, extname: '.max.js'}))
.pipe(gulp.dest(DIST))
.pipe(stripDebug())
.pipe(rename({basename: basename, extname: '.js'}))
.pipe(gulp.dest(DIST))
.pipe(uglify({compress: {properties: false}, output: {'quote_keys': true}}))
.pipe(header(BANNER))
.pipe(rename({basename: basename, extname: '.min.js'}))
.pipe(gulp.dest(DIST))
.pipe(jsOnly.restore)
.pipe(mapOnly)
.pipe(gulp.dest(DIST));
}
return () => webpackStream(config)
.pipe(jsOnly)
.pipe(header(BANNER))
.pipe(rename({basename: basename, extname: '.max.js'}))
.pipe(gulp.dest(DIST))
.pipe(stripDebug())
.pipe(rename({basename: basename, extname: '.js'}))
.pipe(gulp.dest(DIST))
.pipe(uglify({compress: {properties: false}, output: {'quote_keys': true}}))
.pipe(header(BANNER))
.pipe(rename({basename: basename, extname: '.min.js'}))
.pipe(gulp.dest(DIST))
.pipe(jsOnly.restore)
.pipe(mapOnly)
.pipe(gulp.dest(DIST));
}