How can I remove all console.log from production. This code isn't working on laravel-mix 4.x:
webpack.mix.js
mix
.js('resources/js/app.js', 'public/js')
if (mix.inProduction()) {
mix.options({
uglify: {
uglifyOptions: {
warnings: false,
comments: false,
beautify: false,
compress: {
drop_console: true,
}
}
}
});
mix.version();
}
terserOptions
get ignored for development builds (at least in Laravel-mix 5.0.9) - above'sif (mix.inProduction())
check is useless if said is intended (and not a bug). – Goya