Thanks for the support for Lazy Loading and CSS Modules. Would also be great if they could work together.
As far as I can tell, CSS modules that are imported by modules that loaded via import()/React.lazy are appended to CSS files that are loaded immediately rather than alongside the associated JS bundle.
Thanks for the support for Lazy Loading and CSS Modules. Would also be great if they could work together.
As far as I can tell, CSS modules that are imported by modules that loaded via
import()
/React.lazy
are appended to CSS files that are loaded immediately rather than alongside the associated JS bundle.I have something in progress here:
https://github.com/penx/govuk-frontend-react-example
When running a production build, all of the CSS is loaded on page load, even though some of it is only needed by the lazy loaded components.