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
Copy file name to clipboardExpand all lines: README.md
+23-1
Original file line number
Diff line number
Diff line change
@@ -164,8 +164,31 @@ Keep in mind, by default `[name].css` is used when `process.env.NODE_ENV === 'de
164
164
The 2 exceptions are: `allChunks` will no longer do anything, and `fallback` will no longer do anything when passed to to `extract`. Basically just worry about passing your `css-loader` string and `localIdentName` 🤓
165
165
166
166
167
+
### HMR Pitfall
167
168
169
+
The most common workflow when working with webpack is to write a "development" / "production" value in to the
170
+
'process.env.NODE_ENV' namespace, typically, using webpack's built-in "DefinePlugin" plugin. e.g:
The value set by the aformentioned plugin will only be available in the runtime ( when webpack's javascript output is excuted ).
180
+
In order for this plugin to work with hot module reloading, The npm script / gulp task / grunt task etc, should be invoked with the same environment variable as shown above.
181
+
182
+
For example, when running the build using some form of npm script:
[cross-env](https://www.npmjs.com/package/cross-env) is optional but recomanded
169
192
170
193
## What about Aphrodite, Glamor, StyleTron, Styled-Components, Styled-Jsx, etc?
171
194
@@ -226,4 +249,3 @@ We use [commitizen](https://github.com/commitizen/cz-cli), so run `npm run cm` t
226
249
227
250
## More from FaceySpacey in Reactlandia
228
251
-[redux-first-router](https://github.com/faceyspacey/redux-first-router). It's made to work perfectly with *Universal*. Together they comprise our *"frameworkless"* Redux-based approach to what Next.js does (splitting, SSR, prefetching, and routing). *People are lovin it by the way* 😎
0 commit comments