Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit e013ed6

Browse files
committed
fix(dynamic import): enforce default export is not falsy
fixes privatenumber/tsx#281
1 parent 4e91c7b commit e013ed6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/transform/transform-dynamic-import.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { parseEsm } from '../utils/es-module-lexer';
55
const checkEsModule = `.then((mod)=>{
66
const exports = Object.keys(mod);
77
if(
8-
exports.length===1&&exports[0]==='default'&&mod.default.__esModule
8+
exports.length===1&&exports[0]==='default'&&mod.default&&mod.default.__esModule
99
){
1010
return mod.default
1111
}

0 commit comments

Comments
 (0)