Module splitting

WebHare 5.4 now exposes esbuild's option to split the assetpack bundle and reduce initial load JS times

To enable this:

As an example:

assetPacks:
  basetestjs:
    entryPoint: webdesigns/basetestjs/frontend/frontend
    supportedLanguages: [en, nl, ps]
    module: true

Use wh apply assetpacks and republish your site to apply the change. A stub ap.js file will be created that will simply load the module version of your assetpack to deal with pages that haven't been republished yet

Once the assetpack is published as a module, you can use import() to dynamically load modules.

Please note that splitting is still an experimental feature in esbuild. See also https://github.com/evanw/esbuild/issues/16