Open doei opened 7 years ago
If you're just stripping console.log
, I'd recommend using uglifyjs loader. You can use uglifyjs's drop_console
option. Here is what that would look like in a webpack plugin:
new webpack.optimize.UglifyJsPlugin({
compress: {
drop_console: true
}
})
Uglify js would be able to catch all kinds of convoluted invocations of console.log
because it uses an ast parser. Hope this helps.
Thanks for the tip, I'll try.
I'm using strip-loader on a project scaffolded with create-react-app, on which I ran
npm run eject
At some point the project wouldn't build anymore, the build process never exited while exhausting all the cpu resources it could find... After trying to build previous commits to find the breaking change, I managed to have the build work fine again by removing this console.log:
startDate
is a moment object if that helps...Anyway my guess is that this is an issue coming from strip-loader...
Hope it helps