Skip to content

Commit 8a6c722

Browse files
committed
fix(wasm): keep imports
1 parent 11fa1d5 commit 8a6c722

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/wasm/WebAssemblyGenerator.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,8 @@ const rewriteImports = ({ ast, usedDependencyMap }) => bin => {
282282
const result = usedDependencyMap.get(
283283
path.node.module + ":" + path.node.name
284284
);
285-
if (result === undefined) {
286-
path.remove();
287-
} else {
285+
286+
if (typeof result !== "undefined") {
288287
path.node.module = WebAssemblyUtils.MANGLED_MODULE;
289288
path.node.name = result.name;
290289
}

0 commit comments

Comments
 (0)