Open kanonieer opened 2 months ago
@kanonieer Under watch mode, due to the build cache, unchanged files are not re-processed by the plugin, and the assets within them aren't recognized. As a result, it's expected that the outputPath
function won't be called on some assets during rebuilds.
To emit complete assets during rebuilds, this plugin caches all emitted assets and re-emits them during the writeBundle
phase. However, when emitting these cached assets, the import paths in importers are not processed, leading to this bug.
@kanonieer I just released v0.5.25 under the next tag, you can try it to see if it solves your problem.
@coder-layne in version v0.5.25 after changing any file the assets folder is deleted.
In version v0.5.24 I have an error after changing any file and the folder is also deleted.
@kanonieer I just released v0.5.25 under the next tag, you can try it to see if it solves your problem.
@coder-layne The fix you made resolved the issue I had - many thanks for the help :heart: :bowing_man:
@rbatistajs Thanks for your feedback, and can you provide a minimal reproducible version?
Hi, TLDR I have issue that the url to assets get changed in output js files on rebuild in watch mode
Little project setup background:
in
/library
I have a component that imports an svg for background image likeThe
image.svg
is correctly bundled intodist/assets/image.svg
and is correctly linked inmyComponent.js
bundled file asThe issue I have occurs in dev mode in which I have the
library
built viavite build --watch
- when I update code oflibrary
it gets rebuild and the link to asset get updated towhich no longer correctly links to asset folder (assets still exist under previous url)
here is how my
vite.config
looks likeThe issue seems to be similar to the one described there https://github.com/laynezh/vite-plugin-lib-assets/issues/89
PS. I was logging asset within
outputPath
function and I noticed it's only called during first build and not when the lib rebuilds - could it be the issue?Thanks in advance for any help or advice :pray: