Skip to content

Commit

Permalink
fix(ssr-manifest): filter path undefined when dynamic import
Browse files Browse the repository at this point in the history
  • Loading branch information
hoanguyen committed Aug 11, 2022
1 parent b718f95 commit 5b3f493
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/vite/src/node/ssr/ssrManifestPlugin.ts
Expand Up @@ -39,7 +39,7 @@ export function ssrManifestPlugin(config: ResolvedConfig): Plugin {
const code = chunk.code
let imports: ImportSpecifier[]
try {
imports = parseImports(code)[0].filter((i) => i.d > -1)
imports = parseImports(code)[0].filter((i) => i.n && i.d > -1)
} catch (e: any) {
this.error(e, e.idx)
}
Expand Down Expand Up @@ -68,9 +68,7 @@ export function ssrManifestPlugin(config: ResolvedConfig): Plugin {
join(dirname(chunk.fileName), url.slice(1, -1))
)
addDeps(normalizedFile)
if (name) {
ssrManifest[basename(name!)] = deps
}
ssrManifest[basename(name!)] = deps
}
}
}
Expand Down

0 comments on commit 5b3f493

Please sign in to comment.