I think this was done by default using elixir. I've just upgraded a project to Laravel 5.4 and swapped out elixir for Laravel Mix and console.log are still showing when doing a "yarn run production"
Do I need to look at adding something like webpack-strip to my webpack config or is there something easier that I'm missing?
Why is this closed? This is happening to me still on my production server. Yarn or npm run production still showing console.log statements
You can configure all uglify configuration using mix.options, for dropping the console log try the following configuration.
mix.options({
uglify: {
uglifyOptions: {
compress: {
drop_console: true,
}
}
}
});
Still happening for me on a Windows server.
Can confirm the options mentioned by @rjcrystal do work.
Ubuntu 16.04
Node 8.9.4
Uglify: 3.3.9
For anyone who needs to remove logs in mix v4.0.15:
mix.options({
terser: {
terserOptions: {
compress: {
drop_console: true,
}
}
}
})
Most helpful comment
For anyone who needs to remove logs in mix v4.0.15: