Skip to content

Commit b05a567

Browse files
authored
fix(build): respect rollupOtions.external at generate manifest(#2353)
1 parent 4364992 commit b05a567

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/vite/src/node/plugins/manifest.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,14 @@ export function manifestPlugin(config: ResolvedConfig): Plugin {
5858
}
5959

6060
if (chunk.imports.length) {
61-
manifestChunk.imports = chunk.imports.map((file) =>
62-
getChunkName(bundle[file] as OutputChunk)
63-
)
61+
const imports = []
62+
for (const file of chunk.imports) {
63+
const importItem = bundle[file]
64+
importItem && imports.push(getChunkName(importItem as OutputChunk))
65+
}
66+
if (imports.length > 0) {
67+
manifestChunk.imports = imports
68+
}
6469
}
6570

6671
if (chunk.dynamicImports.length) {

0 commit comments

Comments
 (0)