I've done a workaround to replace all ".@id/x00/" and prepend the base and it seems to work fine.
However, I'm not sure if this is a Vite issue, or a issue with the plugin, whether it is calling transformHtml with some missing options or Vite expects it to adjust the module url.
When I upgrade to Vite 5, I get a 404 on scripts if
base
option is in use.I've done some investigation, and found that what is causing the issue is likely to be this change on vite https://github.com/vitejs/vite/pull/5657.
After the plugin calls
transformHtml
it changes:into:
This used to work before 5657, but now is no longer supported. Vite expects it to have the base in the url as below, otherwise it fails with 404:
I've tested without using the template and it works fine as it resolves to:
I've done a workaround to replace all ".@id/x00/" and prepend the base and it seems to work fine.
However, I'm not sure if this is a Vite issue, or a issue with the plugin, whether it is calling
transformHtml
with some missing options or Vite expects it to adjust the module url.Please let me know your thoughts.