Skip to content

Commit

Permalink
docs($flushFiles): added additional note about ways to use flushFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
faceyspacey committed Apr 29, 2017
1 parent dc98ca4 commit 6504859
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<script>window.render()</script>` (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.
Expand Down

0 comments on commit 6504859

Please sign in to comment.