From b72fbd60c8a2fd5228e6f0c5289350329b3a0fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Wed, 4 Sep 2024 21:21:53 +0300 Subject: [PATCH] When building with -sENVIRONMENT=web, do not produce WASI'isms in the build. --- src/postamble_minimal.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/postamble_minimal.js b/src/postamble_minimal.js index f34830f0cbd59..48129edf5958d 100644 --- a/src/postamble_minimal.js +++ b/src/postamble_minimal.js @@ -106,7 +106,13 @@ var imports = { 'a': wasmImports, #else // MINIFY_WASM_IMPORTED_MODULES 'env': wasmImports, + +// There does not currently exist a ENVIRONMENT_MAY_BE_WASI, so liken it to the shell environments. +// (e.g. anyone building with -sENVIRONMENT=web won't be running in WASI) +#if ENVIRONMENT_MAY_BE_NODE || ENVIRONMENT_MAY_BE_SHELL '{{{ WASI_MODULE_NAME }}}': wasmImports, +#endif + #endif // MINIFY_WASM_IMPORTED_MODULES };