Skip to content

feat(build): new manifest format and include html tags - #23837

Open
sapphi-red wants to merge 9 commits into
mainfrom
feat/new-manifest-format-and-include-html-tags
Open

sapphi-red wants to merge 9 commits into
mainfrom
feat/new-manifest-format-and-include-html-tags

Conversation

@sapphi-red

Copy link
Copy Markdown
Member

Plugins using transformIndexHtml does not work well with backend integration or meta-frameworks rendering the HTML on their own. This PR tries to fix that by exposing the tags injected by plugins in the manifest.

This PR introduces a new V1 manifest format, which can be enabled by experimental.newManifestFormat (the old one is now called V0). The format looks like

{
  "version": 1,
  "chunks": { "main.js": { ... } },
  "htmlTags": []
}

During manifest generation, Vite calls transformIndexHtml hooks in their usual order with html set to undefined and the output bundle available in the context. The returned tags are collected and put in the manifest.

The plan is to add more document once it's confirmed that it works and then make the output V1 in the next major.

refs vitejs/ecosystem#15

@sapphi-red sapphi-red added p3-significant High priority enhancement (priority) feat: build labels Oct 19, 2026
@sapphi-red

Copy link
Copy Markdown
Member Author

/ecosystem-ci run

@pkg-pr-new

pkg-pr-new Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@vitejs/plugin-legacy

pnpm add https://pkg.pr.new/@vitejs/plugin-legacy@23837 -D
npm i https://pkg.pr.new/@vitejs/plugin-legacy@23837 -D
yarn add https://pkg.pr.new/@vitejs/[email protected] -D

vite

pnpm add https://pkg.pr.new/vite@23837 -D
npm i https://pkg.pr.new/vite@23837 -D
yarn add https://pkg.pr.new/[email protected] -D

commit: 53a9f99

@vite-ecosystem-ci

Copy link
Copy Markdown

📝 Ran ecosystem CI on a785da0: Open

suite result latest scheduled
module-federation ❌ failure ❌ failure
tanstack-start ⏹️ cancelled ✅ success
unocss ❌ failure ❌ failure
sveltekit ❌ failure ✅ success
vinext ❌ failure ❌ failure
analogjs ❌ failure ❌ failure
vite-plugin-cloudflare ❌ failure ❌ failure
nuxt ❌ failure ✅ success
netlify-vite-plugin ❌ failure ❌ failure
react-router ❌ failure ❌ failure
vitest ❌ failure ❌ failure
vite-plugin-rsc ❌ failure ✅ success
storybook ❌ failure ❌ failure
qwik ❌ failure ❌ failure

✅ vite-plugin-pwa, marko, astro, vitepress, vite-plugin-vue, vike, vite-environment-examples, vite-setup-catalogue, vuepress, laravel, nitro, vite-plugin-react, quasar, vite-plugin-svelte, waku

@sapphi-red

Copy link
Copy Markdown
Member Author

The type errors are expected as this PR changes them

Comment thread packages/vite/src/node/index.ts Resolved
teemingc added a commit to sveltejs/kit that referenced this pull request Nov 17, 2026
The large number of lines changed are just lockfile lines changed.

In a SvelteKit app the Vite DevTools dock never shows up because SSR
apps don't support Vite's `transformIndexHtml` hook which injects the
dock.

This PR now adds the dock as documented in the DevTools
[docs](https://devtools.vite.dev/guide/#projects-without-an-html-entry)
when the package is installed and enabled:

```js
// vite.config.js
export default defineConfig({
	devtools: { apply: 'serve' },
	plugins: [sveltekit()]
});
```

We can remove all of this PR's work once
vitejs/vite#23837 is merged and we support it
(essentially enables `transformIndexHtml` for SSR apps)

---

### Please don't delete this checklist! Before submitting the PR, please
make sure you do the following:

- [ ] It's really useful if your PR references an issue where it is
discussed ahead of time. In many cases, features are absent for a
reason. For large changes, please create an RFC:
https://github.com/sveltejs/rfcs
- [x] This message body should clearly illustrate what problems it
solves.
- [x] Ideally, include a test that fails without this PR but passes with
it.

### Tests

- [ ] Run the tests with `pnpm test` and lint the project with `pnpm
lint` and `pnpm check`

### Changesets

- [x] If your PR makes a change that should be noted in one or more
packages' changelogs, generate a changeset by running `pnpm changeset`
and following the prompts. Changesets that add features should be
`minor` and those that fix bugs should be `patch`. Please prefix
changeset messages with `feat:`, `fix:`, or `chore:`.

### Edits

- [x] Please ensure that 'Allow edits from maintainers' is checked. PRs
without this option may be closed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: build p3-significant High priority enhancement (priority) trigger: preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant