Skip to content

Commit

Permalink
fix(runtime-core): defineAsyncComponent should resolve common js mo…
Browse files Browse the repository at this point in the history
…dule during ssr

fix #vitejs/vite#764
  • Loading branch information
underfin committed Sep 2, 2020
1 parent c73b4a0 commit 2ef9c97
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/runtime-core/src/apiAsyncComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ export function defineAsyncComponent<
// interop module default
if (
comp &&
(comp.__esModule || comp[Symbol.toStringTag] === 'Module')
(__NODE_JS__ ||
comp.__esModule ||
comp[Symbol.toStringTag] === 'Module')
) {
comp = comp.default
}
Expand Down

0 comments on commit 2ef9c97

Please sign in to comment.