Skip to content

Tag: code-splitting

When importing a module from node_modules that uses route based lazy loading in create-react-app, should code splitting work in the same way?

I used create-react-app (react ^17.0.2, react-scripts 4.0.3) to knock up a simple application which uses route based lazy loading to perform code splitting. When I build this application I see separate chunks created per lazy loaded component and this all works fine as all my components are exported using default. My output is: I then updated my package.json file to