Skip to content

Commit

Permalink
docs(plugins): warning about overwriting process via DefinePlugin (#1308
Browse files Browse the repository at this point in the history
)

See these issues for references:

egoist/poi#193
https://github.com/chentsulin/electron-react-boilerplate/pull/245/files

Basically using something like the below example will break the process object compatibility that webpack includes. This just gives a warning about that. 

```javascript
new webpack.DefinePlugin({
   process: {
      env: {
         NODE_ENV: JSON.stringify('production')
      }
   }
})
```
  • Loading branch information
zephraph authored and simon04 committed Jun 20, 2017
1 parent 7bfdfdc commit 6ae2453
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions content/plugins/define-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ new webpack.DefinePlugin({
})
```

W> When defining values for `process` prefer `'process.env.NODE_ENV': JSON.stringify('production')` over `process: { env: { NODE_ENV: JSON.stringify('production') } }`. Using the latter will overwrite the `process` object which can break compatibility with some modules that expect other values on the process object to be defined.


## Service URLs

Expand Down

0 comments on commit 6ae2453

Please sign in to comment.