Repository navigation
Stabilizing build.chunkImportMap
#22703
Replies: 5 comments 10 replies
|
Even if the |
|
Hi @sapphi-red, I'm having following issue, in my understanding it is more on rolldown side including empty chunks in map.
Is this behavior expected/known for now? |
|
Hello! I'm the author of the popular vite-plugin-single-spa, and while I did have issues with Because of my differences and my professional need, I decided I needed to create a new micro-frontends library that was more focused and was more versatile. Enter CollageJS. Specifically, I have split my The IM plug-in is given a user-defined import map, and the plug-in injects it to the top of HEAD along with an IIFE in the @collagejs/imo NPM package. "IMO" stands for "Import Map Override", and is my version of I have just tested this feature in a simple test project, and it looks good, but I wonder: Are there any ways to programmatically access or modify the generated import map for the chunks? I don't have a use case right now. I am just trying to learn about what Vite does and offers just in case I can leverage it or need to battle some edge case. I read the documentation that explains this feature, but other than "it's there, it does this because of this motivation", there's nothing else. |
|
When used with const toCdnUrl = (url) => `map2Cdn`;
const importmapScript = document.createElement('script');
importmapScript.type = 'importmap';
const importmap = {
'xxx.js': toCdnUrl('xxx-1.js')
}
importmapScript.textContent = \`{ "imports": ${JSON.stringify(importmap)} }\`;
document.currentScript.after(importmapScript); |
|
If possible, provide a Vite configuration option to disable automatic injection into // vite.config.js
build: {
chunkImportMap: true,
chunkImportMapRenderToIndexHtml: false
} |

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
build.chunkImportMapWe're opening a discussion to gather feedback about this feature.
All reactions