gajus / prepack-webpack-plugin

A webpack plugin for prepack.
Other
1.04k stars 46 forks source link

Conflict with UglifyJsPlugin #14

Open FateRiddle opened 7 years ago

FateRiddle commented 7 years ago
plugins: [
    new PrepackPlugin(),
    new webpack.optimize.UglifyJsPlugin({
      sourceMap:true,
      compress:true
    })
  ]

Will fire an error:

ERROR in bundle.js from UglifyJs
TypeError: Cannot read property 'section' of null

But if I flip the order of applying plugins, everything is fine:

plugins: [
    new webpack.optimize.UglifyJsPlugin({
      sourceMap:true,
      compress:true
    }),
    new PrepackPlugin()
  ]

And if I turn off sourceMap, everything is also fine.

plugins: [
    new PrepackPlugin(),
    new webpack.optimize.UglifyJsPlugin({
      compress:true
    })
  ]
gajus commented 7 years ago

https://github.com/gajus/prepack-webpack-plugin/issues/11

FateRiddle commented 7 years ago

@gajus I look at the other issue, my issue is that I apply prepack before uglify and yields the problem, not the same issue.