From 650485928d52c6c69fed6821b4217fb66b7d7158 Mon Sep 17 00:00:00 2001 From: James Gillmore Date: Sat, 29 Apr 2017 04:43:04 -0700 Subject: [PATCH] docs($flushFiles): added additional note about ways to use flushFiles --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a485da6..a99e160 100644 --- a/README.md +++ b/README.md @@ -641,6 +641,8 @@ const styles = files.filter(file => /\.css/.test(file)) ``` > i.e. this will get you all files corresponding to flushed "dynamic" chunks, no more +Keep in mind, you will have to get right placing these between your `bootstrap` and `main` scripts. ***OR*** if you don't have a `bootstrap` script, you need to set it up so your `main` script doesn't actually call `ReactDOM.render`, and instead you put `` (where `window.render()` calls `ReactDOM.render`) after all your chunks in your markup so that by the time it's called all your chunks are loaded. In the latter case, you should put your dynamic chunks received from `flushFiles` **after** your `main` script so that the webpack bootstrap code *now within your `main` script* (as it regularly is) knows what to do with the additional scripts from dynamic chunks. + If what you want is full-on compilation `chunk` objects (and any information it contains, which for 99% of most projects is unnecessary), create an issue and we'll add it. But until there is an actual need, we would like to keep the API simple.