Skip to content

Commit 2ac0bd3

Browse files
smonusbonusEugeneHlushko
authored andcommitted
docs(plugins): update DefinePlugin example to comply with recommendation (#2636)
1 parent a970110 commit 2ac0bd3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/content/plugins/define-plugin.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ contributors:
55
- rouzbeh84
66
- byzyk
77
- EugeneHlushko
8+
- smonusbonus
89
---
910

1011
The `DefinePlugin` allows you to create global constants which can be configured at **compile** time. This can be useful for allowing different behavior between development builds and release builds. If you perform logging in your development build but not in the release build you might use a global constant to determine whether logging takes place. That's where `DefinePlugin` shines, set it and forget it rules for development and release builds.
@@ -34,9 +35,7 @@ new webpack.DefinePlugin({
3435
BROWSER_SUPPORTS_HTML5: true,
3536
TWO: '1+1',
3637
'typeof window': JSON.stringify('object'),
37-
'process.env': {
38-
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
39-
}
38+
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
4039
});
4140
```
4241

0 commit comments

Comments
 (0)