Skip to content

Commit 2cb9775

Browse files
authored
Merge pull request faceyspacey#2 from faceyspacey/greenkeeper/initial
fix($npm): update npm docs with badges
2 parents 02617fb + 4485bb2 commit 2cb9775

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ Keep in mind we've added sensible defaults, specifically: `[name].css` is used w
9898
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` 🤓
9999

100100

101+
101102
## How It Works
102103

103104
Just like your JS, it moves all the the required CSS into corresponding css chunk files. So entry chunks might be named: `main.12345.css` and dynamic split chunks would be named: `0.123456.css`, `1.123456.css`, etc. You will however now have 2 files for each javascript chunk: `0.no_css.js` and `0.js`. The former is what you should serve in the initial request (and what [webpack-flush-chunks](https://github.com/faceyspacey/webpack-flush-chunks) in conjunction with [react-loadable](https://github.com/thejameskyle/react-loadable) will automatically serve). The latter, *which DOES contain css injection via style-loader*, is what will asyncronously be loaded in future async requests. This solves the fact that they otherwise would be missing CSS, since the webpack async loading mechanism isn't built to serve both a JS and CSS file. In total, 3 files are created for each named entry chunk and 3 files for each dynamically split chunk, e.g:

npm-debug.log

-27
This file was deleted.

0 commit comments

Comments
 (0)