can pack, but console.log can"t go.
gulp.task("agency:build", ["agency:cache-templates"], function (cb) {
agencySource.js.src.push(agencySource.build.cache + "/app.js");
pump(
[
gulp
.src(agencySource.js.src)
.pipe(envify({ NODE_ENV: "production" }))
.pipe(stripDebug())
.pipe(ngAnnotate())
.pipe(babel())
.pipe(concat("app.js")),
//process.env.NODE_ENV
uglify({ drop_console: true}),
gulp.dest(agencySource.build.cache)
// .pipe(concat("app.js"))
// .pipe(gulp.dest(agencySource.build.cache))
],
cb
);
});
found part of the answer, but the effect is not complete, only part of the console can be removed
uglify({
compress: {
warnings: false,
drop_console: true, // console
drop_debugger: true // debugger
}
})
console.log1200800
`window.console.log = function() {}`console
I hope I can optimize one more. How to get rid of the extra console
ask the bosses to save a wave! Thank you