If an additional entrypoint (vite.config.js: additionalEntrypoints: ['src/js/sections/**/*.js'],) has dynamic imports, is there a way to generate a modulepreload link for them?
For example in sections/hero.liquid:
{%- render 'vite-tag' with '@sections/hero.js' -%}
hero.js has a dynamic import: const { default: Splide } = await import('@splidejs/splide'); which Lighthouse is flagging as a candidate for preloading.
It seems like the entrypoint / module itself gets taken care of by the preload helper that is injected with the the vite-tag snippet, but dynamic imports aren't covered by the helper. I could be mistaken though! Any advice appreciated.
If an additional entrypoint (vite.config.js:
additionalEntrypoints: ['src/js/sections/**/*.js'],
) has dynamic imports, is there a way to generate amodulepreload
link for them? For example in sections/hero.liquid:hero.js has a dynamic import:
const { default: Splide } = await import('@splidejs/splide');
which Lighthouse is flagging as a candidate for preloading.It seems like the entrypoint / module itself gets taken care of by the preload helper that is injected with the the
vite-tag
snippet, but dynamic imports aren't covered by the helper. I could be mistaken though! Any advice appreciated.