Open nojimage opened 2 months ago
Hi, I cannot really understand the issue as in my experience, the files listed under "imports"/"dynamicImports" are imported automatically. So what exactly is insufficient?
Could you please provide more information on how to reproduce the issue? Like how are you using vite exactly, what is your config, how do you use imports in your js files? What version of vite are you using? Do you get any console errors when browsing the site in dev mode/prod mode?
@passchn Thank you for your review.
This issue occurs when importing CSS within JavaScript files.
Here is my environment:
I created a wrapper Vue component for a library made in JavaScript. The original JS library includes CSS, and I imported it from the Vue component.
The JS library itself was bundled into the build without any issues, but the CSS files imported within the JS (located under node_modules
) were output as separate files. It seems that assets used commonly across entry points are compiled into separate files.
This issue arises specifically when assets are imported from JS. Importing CSS files from the node_modules directory within CSS files does not cause any issues. (However, importing them within the <style>
tag of a Vue component is treated similarly to importing them in JS).
This issue occurs during the production build, while the imported CSS files are loaded without any problems in dev mode.
Ok but then it seems more like a bug in the bundler and not of this plugin.. Everything should be imported by the files marked with "isEntry" as far as I understand. I might try to reproduce it on the weekend if I find the time.
Adding the process to load chunk files split by Vite.
Given the following manifest.json:
the helper must also load the files listed in the
imports
, but this processing was insufficient.