I'm using react-loadable to dynamically import the route component, webpack is generating the chunk file but the issue is that the child modules that are imported inside the dynamically imported component is also generated in a separate chunk file. So it's generating multiple chunk files. I tried /* webpackChunkName: "lazyComponent" */
but it didn't worked
Asked
Active
Viewed 89 times
0

harshal patel
- 1
- 1
-
check `commons-chunk-plugin` https://webpack.js.org/plugins/commons-chunk-plugin if it can help – Jagrati May 01 '20 at 18:29
-
Also tried with https://webpack.js.org/plugins/split-chunks-plugin/ (split-chunks-pulgin) but still generating multiple files – harshal patel May 01 '20 at 18:34