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
I would expect that the preload links would also be processed with renderBuiltUrl. Instead, even if I wish to render a relative url, I have to set base: './' rather than { relative: true }.
Not entirely sure how to resolve. Possibly a new hostType, like preload, in which case filename would be the variable name itself (dep) rather than a string?
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.
Thanks for creating the issue @danielroe, at the end we didn't create one to track this missing feature.
Not entirely sure how to resolve. Possibly a new hostType, like preload, in which case filename would be the variable name itself (dep) rather than a string?
What we discussed in the context of:
feat: experimental.renderBuiltUrl (revised build base options) #8762
is that we could add support for modifying the preload URLs once we implement preload config options. We wanted to allow users to disable preload, filter, or modify URLs, and we could also support custom runtime URL modifications. Maybe something like:
The idea was that the context was different enough that was better to avoid overloading renderBuiltUrl. The only issue I see is that if we graduate renderBuiltUrl to a hook, then plugins are going to be able to collaborate constructing it, but they would not be able to do the same with preload URLs. Maybe instead of adding it to build.preload we could have an experimental.renderPreloadUrl and leave build.preload only for global disable/filtering. renderPreloadUrl can have most of the same params as renderBuiltUrl (except for hostType that is always JS, and filename is varName`).
I'll see if I can work on this feature later this week.
Describe the bug
I would expect that the preload links would also be processed with
renderBuiltUrl
. Instead, even if I wish to render a relative url, I have to setbase: './'
rather than{ relative: true }
.vite/packages/vite/src/node/plugins/importAnalysisBuild.ts
Lines 113 to 121 in 905b8eb
Not entirely sure how to resolve. Possibly a new
hostType
, likepreload
, in which casefilename
would be the variable name itself (dep
) rather than a string?Reproduction
https://stackblitz.com/edit/vitejs-vite-n3egg4
dist/assets/index.1ebc8c94.js
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: