-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Assets created from plugin with this.emitFile
have broken URL
#4748
Labels
Comments
I realized that this can be solved by using Thanks all for your work <3 |
Closing as this is fixed by #8665 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
I created a simple plugin which transforms an image into multiple different sizes and creates a virtual file with mapping of
{size: "url"}
. The URLs are created withpluginContext.emitFile({"type": "asset", ...})
and the resulting reference is placed inimport.meta.ROLLUP_FILE_URL_${ref}
as per docs. It works perfectly when building with Rollup, but with Vite (no matter if I use the plugin in build.rollupOptions or in Vite plugins directly), broken code is generated.Code generated by the plugin:
Rollup output
Vite output
Reproduction
Repo: https:/mvolfik/symmetrical-train/tree/46722dec52f64b7c8501a2789d33f527e1fea87f
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: