React-static: uglifyjs doesnt work with hooks - move to `terser`?

Created on 29 Jan 2019  路  3Comments  路  Source: react-static/react-static

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

bug enhancement

Most helpful comment

Terser seems to be the successor to Uglify now. I've had no problem replacing it in other projects.

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

empz picture empz  路  3Comments

thupi picture thupi  路  3Comments

tomagladiator picture tomagladiator  路  3Comments

killvung picture killvung  路  3Comments

lottamus picture lottamus  路  3Comments