terser-webpack-plugin icon indicating copy to clipboard operation
terser-webpack-plugin copied to clipboard

Support for other devtool options for development mode

Open daveisfera opened this issue 6 years ago • 6 comments

  • Operating System: macOS 10.14.6
  • Node Version: 12.11.1
  • NPM Version: 6.11.3
  • webpack Version: 4.41.0
  • terser-webpack-plugin Version: 1.4.1

Feature Proposal

Support more options for devtool, in particular, the development friendly ones

Feature Use Case

Currently, only the slowest options for devtool are supported, but this makes development builds take longer than they need to and it would be nice to be able to use the cheaper options for devtool

daveisfera avatar Oct 18 '19 22:10 daveisfera

Unfortunately, support for others is not possible for technical reasons, for example eval* can't be handled terser, also many of devtool for development mode, where unnecessary use minimizer. Anyway i mark this as enhancement if somebody have ideas how it can be implemented. PR welcome.

alexander-akait avatar Oct 19 '19 12:10 alexander-akait

That makes sense. Go ahead and close this out, if there's not a good way to do this.

daveisfera avatar Oct 19 '19 16:10 daveisfera

@evilebottnawi is Terser not behaving as it should in the face of eval for some reason? Please do let me know.

fabiosantoscode avatar Dec 16 '19 22:12 fabiosantoscode

@fabiosantoscode because we have code + source maps inside eval function, so it is normal what terser doesn't handle that :smile:

alexander-akait avatar Dec 17 '19 09:12 alexander-akait

@evilebottnawi Terser can minify new Function(...) in some situations, given the unsafe_Function option is enabled. If required, we can minify eval as well.

fabiosantoscode avatar Dec 17 '19 11:12 fabiosantoscode

@fabiosantoscode it will be great :smile: , just do simple example webpack config with devtool: 'eval' and look how at this

alexander-akait avatar Dec 17 '19 12:12 alexander-akait