-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamically-imported chunks import other dynamically-imported chunks that they shouldn't #12
Comments
Hey! I'm glad to see you again. 😄 You can try to configure /**
* If you want to exclude some files
* e.g `type.d.ts`, `interface.ts`
*/
onFiles?: (files: string[], id: string) => typeof files | void https://github.com/vite-plugin/vite-plugin-dynamic-import#api |
Hey, me too 😎 Can you please explain this setting "assets/uplot.renderer.ba13ce3a.js": {
"chunkName": "uplot.renderer",
"isDynamicEntry": true,
"imports": [
"assets/d3fc.renderer.7df595b8.js", // another top-level module: SHOULD NOT BE IMPORTED
"assets/echarts.renderer.4cf1a1d8.js", // another top-level module: SHOULD NOT BE IMPORTED
"assets/uplot.a2bc4425.js", // exclusive dependency, should be imported
"assets/d3.7530ac4e.js", // dependency of another top-level module: SHOULD NOT BE IMPORTED by this chunk, but can be imported dynamically
"assets/vendor.ce91b36d.js", // dependency, should be imported
"assets/workerpool.47e82dea.js", // dependency of a common import, should be imported
"assets/echarts.f2fcefab.js" // dependency of another top-level module: SHOULD NOT BE IMPORTED by this chunk, but can be imported dynamically
]
}, |
It looks like Rollup's behavior. I need some time to figure it out. 😅 |
Oh no 😅 |
@caoxiemeihao Have you had a chance to take another look at this? If you could give me pointers on where inside Rollup I should look, that would help me debug it myself, because I get lost in there pretty quick! 😅 |
I'd like to know where your data came from "assets/uplot.renderer.ba13ce3a.js": {
"chunkName": "uplot.renderer",
"isDynamicEntry": true,
"imports": [
"assets/d3fc.renderer.7df595b8.js", // another top-level module: SHOULD NOT BE IMPORTED
"assets/echarts.renderer.4cf1a1d8.js", // another top-level module: SHOULD NOT BE IMPORTED
"assets/uplot.a2bc4425.js", // exclusive dependency, should be imported
"assets/d3.7530ac4e.js", // dependency of another top-level module: SHOULD NOT BE IMPORTED by this chunk, but can be imported dynamically
"assets/vendor.ce91b36d.js", // dependency, should be imported
"assets/workerpool.47e82dea.js", // dependency of a common import, should be imported
"assets/echarts.f2fcefab.js" // dependency of another top-level module: SHOULD NOT BE IMPORTED by this chunk, but can be imported dynamically
]
}, |
Using rollup-plugin-extract-bundle-tree |
Sorry for the confusing title. Allow me to quickly explain:
I'm on the latest versions of this plugin and vite. I have this code which dynamically imports a module:
const chart = await import(`@/renderers/${renderer}/${renderer}.js`);
(That's a link, in case you want to see the source code)Here's a short description of my usage:
import
s, and all of them also have exclusive dependencies, that are not imported by any other module.In reality, however, my bundle ends up with these modules importing each other:
Is there any way to control this behavior? Thanks a lot!!!
The text was updated successfully, but these errors were encountered: