Replies: 6 comments 5 replies
-
Some references how this is handled by other tools:
|
Beta Was this translation helpful? Give feedback.
-
IMO
For 1, this proposal is not related since we don't reference it from code. For 2, this happens when the file is referenced from a non-JS file. For a JS file, you can just use For 3, we can take advantage of this proposal. |
Beta Was this translation helpful? Give feedback.
-
I find it unnatural that the imports are not included in the bundle and only used to resolve paths. But that might be just because I'm not used to it. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone. It seems that there is no clear resolution yet about leveraging the Advanced Base Option beyond the experimental scenarios, or am I simply not looking in the right places? Admittedly, I'm still relatively uneducated regarding building component libraries. Still, after reviewing numerous articles about building component libraries, in my case specifically for Vue 3, I could not find clear-cut indications of how one would go about using a Font Awesome icon library, brand-specific custom CSS files or other brand-specific assets like various SVG and PNG image assets for example when building custom SFC's or globals for that matter, without being able to "pull" those assets in from some arbitrary or conditional distribution of project folders. Any search on "how to apply the Advanced Base Option" when building component libraries comes back empty-handed, except for the relevant section in the Vite documentation. The rest of the planet is surprisingly silent about it, regarding use cases, tutorials or even articles mentioning this build approach. Or am I stupidly ignorant and missing the actual functionality of this experimental feature? Can any of you possibly give me pointers to other references, even if it's one pointing me to the "forget-about-it-go-to-exit" route? |
Beta Was this translation helpful? Give feedback.
-
I just came around related issue. I will list my use-case here. Hope it helps with designing this feature. Im using Vite to bundle my custom component library. (Vite Library mode) There are also svg icons in There is If I add Workaround Im currently using: Vite static copy plugin. |
Beta Was this translation helpful? Give feedback.
-
I'm not sure, but I wrote a library that supports multiple shared folders. You can see the library here, and the documentation here. Does it help you? |
Beta Was this translation helpful? Give feedback.
-
Currently the docs says:
It is however possible to do so, with the caveat that we don't guarantee it to work. In fact
plugin-vue
's asset transform converts all URLs as import viaincludeAbsolute: true
, so theorectically this have always been supported.Proposal
We should allow importing from
public
and polish up any bugs regarding it.Benefits
base
set, and how the advanced base options are used.Note
If we follow the docs and specify
"/image.png"
as a string instead, this does not work forbase
./
and/foo/
as the page would be requesting fromhttps://example.com/
instead ofhttps://example.com/foo/
. Unless we hardcode as"/foo/image.png"
, this won't work with dynamic base too.Related issues
Beta Was this translation helpful? Give feedback.
All reactions