shellscape / webpack-manifest-plugin

webpack plugin for generating asset manifests
MIT License
1.44k stars 185 forks source link

Pass `entrypoints` param to `generate` function #192

Closed samuelmeuli closed 5 years ago

samuelmeuli commented 5 years ago

We are using create-react-app and would like to generate the index.html file on the server. In order to get code splitting to work, we need to know which code chunks are entrypoints of the React app (to be able to request these from the HTML file).

In https://github.com/facebook/create-react-app/issues/5513#issuecomment-486838664, it was suggested to add an "entrypoints" key to create-react-app's asset-manifest.json file with a list of these chunks (in the order they need to be included).

This PR passes an additional parameter called entrypoints to the generate function, which provides enough information to be able to build such a manifest file.