Skip to content

Commit e9195c4

Browse files
authored
Merge pull request webpack#7466 from xtuc/fix-wasm-keep-imports
wasm: keep imports
2 parents 53f7deb + 8a6c722 commit e9195c4

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
@@ -292,9 +292,8 @@ const rewriteImports = ({ ast, usedDependencyMap }) => bin => {
292292
const result = usedDependencyMap.get(
293293
path.node.module + ":" + path.node.name
294294
);
295-
if (result === undefined) {
296-
path.remove();
297-
} else {
295+
296+
if (typeof result !== "undefined") {
298297
path.node.module = WebAssemblyUtils.MANGLED_MODULE;
299298
path.node.name = result.name;
300299
}

0 commit comments

Comments
 (0)