webpack-contrib/uglifyjs-webpack-plugin

Map sourceMap to devtool

stevenvachon opened this issue · 6 comments

  • Operating System: macOS 10.14
  • Node Version: 10.11.0
  • NPM Version: 6.4.1
  • webpack Version: 4.20.2
  • uglifyjs-webpack-plugin Version: 2.0.1

Currently, the sourceMap option must be explicitly defined when it'd be much more convenient for it to rely on the value of Webpack's devtool option.

@stevenvachon please format your issue using issue template and reopen

I'm not allowed to reopen an issue that's been closed by a collaborator.

Yeah, this is an unfortunate side-effect - if one sets devtool in the base Webpack config, UglifyJsPlugin should read that config and respond accordingly..

Or at least emit some sort of warning - currently there is no way to tell from build output that sourceMap is needed. If you have 10+ plugins, how do you know which one is causing the issue?

It is actually, IMO, a bug that souceMap: true doesn't get set by UglifyJsPlugin because it alters the way the base Webpack configuration affects the build process.

It was fixed in next major release, because it is breaking change