vite
vite copied to clipboard
fix: `build.modulePreload.resolveDependencies` is optimizable
Description
The document of build.modulePreload.resolveDependencies had
Returning a relative path to the
hostIdforhostType === 'js'is allowed, in which casenew URL(dep, import.meta.url)is used to get an absolute path when injecting this module preload in the HTML head.
, but actually this wasn't true. build.modulePreload.resolveDependencies does not expect a relative path to the hostId. It expects a relative path to build.outDir. The result of build.modulePreload.resolveDependencies is passed to toOutputFilePathWithoutRuntime or toOutputFilePathInJS.
close #13169 (indirectly)
Additional context
What is the purpose of this pull request?
- [x] Bug fix
- [ ] New Feature
- [ ] Documentation update
- [ ] Other
Before submitting the PR, please make sure you do the following
- [x] Read the Contributing Guidelines, especially the Pull Request Guidelines.
- [x] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
- [x] Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g.
fixes #123). - [x] Update the corresponding documentation if needed.
- [ ] Ideally, include relevant tests that fail without this PR but pass with it.
Run & review this pull request in StackBlitz Codeflow.
/ecosystem-ci run
📝 Ran ecosystem CI on 5caea89: Open
| suite | result | latest scheduled |
|---|---|---|
| sveltekit | :x: failure | :x: failure |
| vike | :x: failure | :x: failure |
| vite-plugin-vue | :x: failure | :white_check_mark: success |
| vitest | :x: failure | :x: failure |
:white_check_mark: analogjs, astro, histoire, ladle, laravel, marko, nuxt, previewjs, quasar, qwik, rakkas, remix, unocss, vite-plugin-pwa, vite-plugin-react, vite-plugin-react-pages, vite-plugin-react-swc, vite-plugin-svelte, vite-setup-catalogue, vitepress
Resolved conflicts 👍 I guess the vite-plugin-vue fail happened because the branch was old.
/ecosystem-ci run
📝 Ran ecosystem CI on ddb3812: Open
| suite | result | latest scheduled |
|---|---|---|
| histoire | :white_check_mark: success | :x: failure |
| nuxt | :x: failure | :x: failure |
| vike | :x: failure | :x: failure |
| vitest | :x: failure | :x: failure |
:white_check_mark: analogjs, astro, ladle, laravel, marko, previewjs, quasar, qwik, rakkas, remix, sveltekit, unocss, vite-plugin-pwa, vite-plugin-react, vite-plugin-react-pages, vite-plugin-react-swc, vite-plugin-svelte, vite-plugin-vue, vite-setup-catalogue, vitepress