govuk-react-jsx
govuk-react-jsx copied to clipboard
Not all dynamic imports receive proper names at build time
Govuk js is imported dynamically and given names with webpack magic comments as follows:
if (typeof document !== 'undefined') {
const { default: ButtonJS } = await import(
/* webpackChunkName: "govuk-frontend-button" */
/* webpackMode: "lazy" */
/* webpackPrefetch: true */
'govuk-frontend/govuk/components/button/button'
);
new ButtonJS(buttonRef.current).init();
}
However, not all of the output files have their names assigned correctly. For example, this is the build output from govuk-react-jsx-examples:
Need to work out why...