How to config webpack-chunks.json path?
susan-github opened this issue · comments
Config the server.output look like './static/dist/server.js', the webpack-chunks.json file will be built to output path, because of the old project using ”clean-webpack-plugin“ plugin, so the dist folder will be removed which caused 'universal-webpack' find './static/dist' failed.
If you have any suggestions? If there has any way to config webpack-chunks.json path individually.
{ "server": { "input": "./src/server/index.js", "output": "./static/dist/server.js" }, "loadExternalModuleFileExtensions": ["css", "png", "jpg", "svg", "xml"], "silent": true, "chunk_info_filename": "webpack-chunks.json" }
The example project uses clean-webpack-plugin
and it works.
https://github.com/catamphetamine/webpack-react-redux-server-side-render-example
That project builds server in build/server
and client in build/assets
and webpack-chunks.json
is generated in build
so it's not cleared: only build/assets
is cleared.
The code adds universal-webpack
plugin after clean
plugin so normally universal-webpack
plugin can't run before clean
.
universal-webpack/source/client configuration.js
Lines 18 to 34 in 3b022b5
Examine your resulting webpack config and see the order.