You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 build in 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
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.
Describe the bug
TL;DR:
build.modulePreload
set tofalse
doesn’t work. As a workaround, one can set it to{ resolveDependencies: () => [] }
instead.Related:
Reproduction
https://stackblitz.com/edit/vitejs-vite-wgn89w?file=vite.config.js
Steps to reproduce
build.modulePreload: false
. According to https://vitejs.dev/config/build-options.html#build-modulepreload, this should turn off module preload.yarn build
in 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 offalse
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.4
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: