not sure if this is a bug but just opening a discussion about this issue when using react-static with hooks. when doing a prod build this happens:
and the maintainers of uglify dont seem to be fixing it so we may need to move to terser
crappy temporary solution is to disable uglification
// node.api.js
export default pluginOptions => ({
webpack: config => {
// hooks dont work with uglifyjs https://github.com/webpack-contrib/uglifyjs-webpack-plugin/issues/374
if (config.optimization.minimizer) config.optimization.minimizer.shift()
return config
},
})
I would be okay moving to Terser as long as it's non-breaking.
Terser seems to be the successor to Uglify now. I've had no problem replacing it in other projects.
Most helpful comment
Terser seems to be the successor to Uglify now. I've had no problem replacing it in other projects.