diff --git a/README.md b/README.md index e5cfa3d2..90a1fecd 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,7 @@ Keep in mind we've added sensible defaults, specifically: `[name].css` is used w 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` 🤓 + ## How It Works 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: diff --git a/npm-debug.log b/npm-debug.log deleted file mode 100644 index 42c9038a..00000000 --- a/npm-debug.log +++ /dev/null @@ -1,27 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ '/Users/jamesgillmore/.nvm/versions/node/v7.7.2/bin/node', -1 verbose cli '/Users/jamesgillmore/.nvm/versions/node/v7.7.2/bin/npm', -1 verbose cli 'run', -1 verbose cli 'start:babel:dev' ] -2 info using npm@4.1.2 -3 info using node@v7.7.2 -4 verbose stack Error: missing script: start:babel:dev -4 verbose stack at run (/Users/jamesgillmore/.nvm/versions/node/v7.7.2/lib/node_modules/npm/lib/run-script.js:151:19) -4 verbose stack at /Users/jamesgillmore/.nvm/versions/node/v7.7.2/lib/node_modules/npm/lib/run-script.js:61:5 -4 verbose stack at /Users/jamesgillmore/.nvm/versions/node/v7.7.2/lib/node_modules/npm/node_modules/read-package-json/read-json.js:356:5 -4 verbose stack at checkBinReferences_ (/Users/jamesgillmore/.nvm/versions/node/v7.7.2/lib/node_modules/npm/node_modules/read-package-json/read-json.js:320:45) -4 verbose stack at final (/Users/jamesgillmore/.nvm/versions/node/v7.7.2/lib/node_modules/npm/node_modules/read-package-json/read-json.js:354:3) -4 verbose stack at then (/Users/jamesgillmore/.nvm/versions/node/v7.7.2/lib/node_modules/npm/node_modules/read-package-json/read-json.js:124:5) -4 verbose stack at /Users/jamesgillmore/.nvm/versions/node/v7.7.2/lib/node_modules/npm/node_modules/read-package-json/read-json.js:311:12 -4 verbose stack at /Users/jamesgillmore/.nvm/versions/node/v7.7.2/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16 -4 verbose stack at tryToString (fs.js:448:3) -4 verbose stack at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:435:12) -5 verbose cwd /Users/jamesgillmore/React/extract-text-webpack-plugin -6 error Darwin 15.6.0 -7 error argv "/Users/jamesgillmore/.nvm/versions/node/v7.7.2/bin/node" "/Users/jamesgillmore/.nvm/versions/node/v7.7.2/bin/npm" "run" "start:babel:dev" -8 error node v7.7.2 -9 error npm v4.1.2 -10 error missing script: start:babel:dev -11 error If you need help, you may report this error at: -11 error -12 verbose exit [ 1, true ]