-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Closed
Labels
p2-edge-caseBug, but has workaround or limited in scope (priority)Bug, but has workaround or limited in scope (priority)
Description
Describe the bug
TL;DR: build.modulePreload set to false doesn’t work. As a workaround, one can set it to { resolveDependencies: () => [] } instead.
Related:
Reproduction
Steps to reproduce
- In a project that will be split into chunks on build and whose chunks are referenced in an entry point (the provided reproduction serves as an example of this), set
build.modulePreload: false. According to https://vitejs.dev/config/build-options.html#build-modulepreload, this should turn off module preload. - Build the project (e.g.
yarn buildin the provided reproduction).
Observe how the resulting index.html file contains <link rel=modulepreload ...> elements. This shouldn’t be the case.
Workaround: use { resolveDependencies: () => [] } instead of false
System Info
Binaries:
Node: 16.14.2 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 7.17.0 - /usr/local/bin/npm
npmPackages:
vite: ^4.0.4 => 4.0.4Used Package Manager
yarn
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
gajus
Metadata
Metadata
Assignees
Labels
p2-edge-caseBug, but has workaround or limited in scope (priority)Bug, but has workaround or limited in scope (priority)