Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite injects __vitePreload even if the modulePreload option is disabled #18551

Open
7 tasks done
lubomirblazekcz opened this issue Nov 1, 2024 · 2 comments
Open
7 tasks done

Comments

@lubomirblazekcz
Copy link
Contributor

lubomirblazekcz commented Nov 1, 2024

Describe the bug

Vite injects __vitePreload on each dynamic import, I would expected this not be included when modulePreload is set to false.

Eg. If I want to handle preloading manually or not at all.

Related #13952 #13973

Reproduction

https://stackblitz.com/edit/vitejs-vite-p54vgg

Steps to reproduce

Run vite build and the output is actually larger then the source.

System Info

..

Used Package Manager

npm

Logs

No response

Validations

@bluwy
Copy link
Member

bluwy commented Nov 1, 2024

Related: #13973

@vritant24
Copy link

In our scenario, preloading any file causes errors as we have a tricky way of resolving file paths (our code runs inside a vscode controlled iframe).
Specifically __vitePreload injects a stylesheet link that causes our page to not load.

Following the referenced PRs and issues, I understand why it's the case, but is there a workaround to prevent the runtime injection of the preloads today?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants