Skip to content

fix(html): insert import map before modulepreload that is not self-close tag#21409

Merged
sapphi-red merged 2 commits into
mainfrom
fix/html-insert-importmap-before-module-preload
Jun 10, 2026
Merged

fix(html): insert import map before modulepreload that is not self-close tag#21409
sapphi-red merged 2 commits into
mainfrom
fix/html-insert-importmap-before-module-preload

Conversation

@sapphi-red

Copy link
Copy Markdown
Member

fixes #20979

I wasn't able to create a test case that actually errors. But I think the code was wrong. This regex should match not only <link rel="modulepreload" ... /> but also<link rel="modulepreload" ...>.

@sapphi-red sapphi-red added feat: html p3-minor-bug An edge case that only affects very specific usage (priority) labels Jan 14, 2026
@sapphi-red

Copy link
Copy Markdown
Member Author

/ecosystem-ci run

@pkg-pr-new

pkg-pr-new Bot commented Jun 9, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vitejs/plugin-legacy

pnpm add https://pkg.pr.new/@vitejs/plugin-legacy@21409 -D
npm i https://pkg.pr.new/@vitejs/plugin-legacy@21409 -D
yarn add https://pkg.pr.new/@vitejs/plugin-legacy@21409.tgz -D

vite

pnpm add https://pkg.pr.new/vite@21409 -D
npm i https://pkg.pr.new/vite@21409 -D
yarn add https://pkg.pr.new/vite@21409.tgz -D

commit: d8364f9

@vite-ecosystem-ci

Copy link
Copy Markdown

📝 Ran ecosystem CI on a02e7ed: Open

suite result latest scheduled
tanstack-start failure failure
marko success failure
vite-plugin-cloudflare failure failure
react-router failure failure
vitest failure failure
astro failure failure

analogjs, laravel, storybook, nuxt, vite-plugin-react, vite-plugin-svelte, vite-plugin-vue, vike, vite-plugin-rsc, qwik, sveltekit, module-federation, quasar, unocss, vite-plugin-pwa, vite-environment-examples, vitepress, vuepress, vite-setup-catalogue, waku

@sapphi-red sapphi-red merged commit e399c89 into main Jun 10, 2026
33 of 34 checks passed
@sapphi-red sapphi-red deleted the fix/html-insert-importmap-before-module-preload branch June 10, 2026 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: html p3-minor-bug An edge case that only affects very specific usage (priority) trigger: preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

<script type=importmap> is always wrongly placed closely before <script type=module> when building

1 participant