-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Priority: MediumMedium priority. Upvote to upgrade; downvote to downgrade.Medium priority. Upvote to upgrade; downvote to downgrade.SveltekitRelated to Sveltekit.Related to Sveltekit.
Description
Problem
Sveltekit doesn't support the transformIndexHtml Vite hook. This is where @collagejs/vite-im collects import map information and injects it into the page. Since Sveltekit projects don't run this hook, the plug-in doesn't work with it.
Proposed Solution
Until the day the Vite hook is supported, I see no other way than creating a new plug-in, @collagejs/vite-kit, that:
- During development (
npm run dev), uses a brute-force method to intercept all generated HTML responses to inject the import map - During build, provides the transformPageChunk server hook to perform the same injection
This is the only way I see ATM to beat Vite's HMR client script injection (that renders import maps useless).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Priority: MediumMedium priority. Upvote to upgrade; downvote to downgrade.Medium priority. Upvote to upgrade; downvote to downgrade.SveltekitRelated to Sveltekit.Related to Sveltekit.