govuk-react-jsx icon indicating copy to clipboard operation
govuk-react-jsx copied to clipboard

Not all dynamic imports receive proper names at build time

Open andymantell opened this issue 4 years ago • 1 comments

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:

image

Need to work out why...

andymantell avatar Aug 03 '20 08:08 andymantell