gajus / gajus/prepack-webpack-plugin

Conflict with UglifyJsPlugin

Open
#14 2 comments 4 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
1k
Forks
31
PR merge metrics
No merged PRs in 30d

Description

```
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
})
]
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the webpack configuration shown in the issue and reproduce the error using PrepackPlugin before UglifyJsPlugin with sourceMap enabled. Compare the failing order with the working reversed order and source-map-disabled case; done means the reported combination no longer throws the UglifyJs “section” error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.