splitchunksplugin

Webpack v4 creating tiny chunks (by route)

做~自己de王妃 提交于 2019-12-22 10:07:22
问题 This is some of the code I'm using in my React app. My routes are written using react-router-config which allows me to keep a centralized way so I know where to go always in order to modify or add some. const routes = [ { component: Root, routes: [ { path: "/", exact: true, component: Home }, { path: "/child/:id", component: Child, routes: [ { path: "/child/:id/grand-child", component: GrandChild } ] } ] } ]; Then, let's say the Child component is dinamically imported: const Child = lazy(() =