Open Andarist opened 2 years ago
We need better support for unbundled scripts. I like the idea of putting them in public
, seems like a reasonable approach is to check if a script in the manifest or an HTML file is in public; we can simply copy these over.
Build tool
Vite
Where do you see the problem?
Describe the bug
I need to load an external UMD script for a devtool's panel. Ideally, a blocking one because it creates a global variable that I need to use in the app.
My intuition was to just put it in the
/public
directory and reference it frompanel.html
. While this has worked (mostly?):I got warnings from Vite (?) that I should reference files from
/public
using the root and that I should use/elk-0.7.1.js
. So I've followed the advice:Unfortunately this change stopped loading the referenced script so I've kept digging and I've found out that this got "processed" into this:
As we may notice - both scripts include
/src/
in the path but that was never the intention here. Luckily, I will be able to easily fix this. However, I did not see any error about it whatsoever - despite that it seems that there is aconsole.error
here, associated with this request.Reproduction
I could try to minimize my repro case later but I hope that the description of the issue is somewhat clear.
Logs
No response
System Info
Severity
annoyance