aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/extern-post-js.c-pp.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2023-01-27 01:33:12 +0000
committerstephan <stephan@noemail.net>2023-01-27 01:33:12 +0000
commit0cd38cd2b9adb966e4ff02596526725311fadf64 (patch)
tree1712db9a14f4c675e55f68eee1428006a4226ffd /ext/wasm/api/extern-post-js.c-pp.js
parent0945197a39896ec49ecfffd8f7b10ecc844020ac (diff)
downloadsqlite-0cd38cd2b9adb966e4ff02596526725311fadf64.tar.gz
sqlite-0cd38cd2b9adb966e4ff02596526725311fadf64.zip
Beginnings of a bundler-friendly build of sqlite3.mjs. Not yet ready for downstream testing.
FossilOrigin-Name: 4271bf5f41df091696f1dcfc4ffe7a60d24066fc75c896941e0b56de95fe5f89
Diffstat (limited to 'ext/wasm/api/extern-post-js.c-pp.js')
-rw-r--r--ext/wasm/api/extern-post-js.c-pp.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/wasm/api/extern-post-js.c-pp.js b/ext/wasm/api/extern-post-js.c-pp.js
index 225869794..87d99eaba 100644
--- a/ext/wasm/api/extern-post-js.c-pp.js
+++ b/ext/wasm/api/extern-post-js.c-pp.js
@@ -105,6 +105,10 @@ const toExportForES6 =
document?.currentScript?.src);
}
}
+//#ifnot target=es6-module
+// Emscripten does not inject these module-loader bits in ES6 module
+// build and including them here breaks JS bundlers, so elide them
+// from ES6 builds.
/* Replace the various module exports performed by the Emscripten
glue... */
if (typeof exports === 'object' && typeof module === 'object'){
@@ -114,6 +118,7 @@ const toExportForES6 =
}
/* AMD modules get injected in a way we cannot override,
so we can't handle those here. */
+//#endif // !target=es6-module
return self.sqlite3InitModule /* required for ESM */;
})();
//#if target=es6-module