Documentation is
Explain in Detail
Currently in plugin development, if you want to emit a file and then reference it, you need to use the __VITE_ASSET__${fileHandle}__ pattern to get the url , there are many examples like this, such as imagetools.
The problem is : this pattern is undocumented, and subsequent plugin developers need to view the source code to continue development.
Your Suggestion for Changes
- Document this section in the same way as Rollup's File URLs.
- Expose a new function like
buildAssetUrl : The function receives fileHandle as an argument and returns the corresponding asset url.
Reproduction
No response
Steps to reproduce
No response
Documentation is
Explain in Detail
Currently in plugin development, if you want to emit a file and then reference it, you need to use the
__VITE_ASSET__${fileHandle}__pattern to get the url , there are many examples like this, such as imagetools.The problem is : this pattern is undocumented, and subsequent plugin developers need to view the source code to continue development.
Your Suggestion for Changes
buildAssetUrl: The function receives fileHandle as an argument and returns the corresponding asset url.Reproduction
No response
Steps to reproduce
No response