You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The plugin lets us create a global constant for our entire bundle, which we could name anything,
269
-
such as `DONT_USE_IN_PRODUCTION: true`, but more practically, a popular choice that looks a bit more
270
-
familiar is `process.env.NODE_ENV: JSON.stringify('production')`. Why `JSON.stringify`? Because
271
-
according to the docs:
269
+
such as `DONT_USE_IN_PRODUCTION: true`, but more practically, it's a much better choice to use
270
+
`process.env.NODE_ENV: JSON.stringify('production')`. This is because many programs recognize and
271
+
use `process.env.NODE_ENV` for additional features and optimization of your code.
272
+
273
+
Why `JSON.stringify`? Because according to the docs:
272
274
273
275
> If the value is a string it will be used as a code fragment.
274
276
@@ -302,7 +304,16 @@ if (process.env.NODE_ENV !== 'production') {
302
304
}
303
305
```
304
306
305
-
I touched upon a real world usage of this in an isolated section of part 1 [here](https://github.com/AriaFallah/WebpackTutorial/tree/master/part1/html-reload).
307
+
In our current project we could say to exclude the hot reloading if it's in production:
0 commit comments