Closed devMacMan closed 7 months ago
Have you tried to remove the plugin? I think it's not where the problem is, because this plugin actually don't handle any files, it just redirect.🤔
You're right. The problem was with the file paths; in the setup, as in my example, they should be as follows:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><%= title %></title>
<script type="module" src="/src/index.js"></script>
</head>
<body>
<div>Hi there!</div>
<img src="/src/image.jpg" alt="" srcset="" />
</body>
</html>
My bad, sorry :)
Thank you for your time and effort in developing this plugin. It is truly a valuable.
Thanks for your approval!
Actually I did worry about this before, so I validate the entry
field in config at when this plugin was created.
But It seems you manually add entry in html file, which I can't control and seems a little kind of out of the plugin's capabilities.
Hello,
I've run into a problem with
vite-plugin-virtual-mpa
where static resources (images) and JavaScript module paths are not being processed correctly when specified in the HTML template.config file:
src/index.html
Template Example:Issue: When running a build, the process fails with errors indicating it cannot resolve index.js from the HTML files. This error specifically occurs when I include a JavaScript module in my HTML template. Additionally, even when the JavaScript module reference is removed, the build process still ignores all static resources, such as images. This suggests that the plugin does not correctly process static resource paths in the HTML templates.
Error message:
Expected Behavior: I expected all specified paths (to static resources and JS modules) in the HTML template to be processed correctly, akin to how Vite typically handles resource paths.
Seeking Help: Is this behavior currently supported? If not, are there any configurations or workarounds to achieve the expected handling of static resources and JS modules in this setup?
Thank you for any guidance or suggestions you might have.