diff options
author | stephan <stephan@noemail.net> | 2022-11-19 05:26:45 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2022-11-19 05:26:45 +0000 |
commit | 27a67968af60dfa5e2146b618df149c0bcea4997 (patch) | |
tree | 087280243b5806d3048543521b66e20dfb5d8b05 /ext/wasm/api/extern-post-js.js | |
parent | c768ef7289c747b5f487319503d9150ef97bfc13 (diff) | |
download | sqlite-27a67968af60dfa5e2146b618df149c0bcea4997.tar.gz sqlite-27a67968af60dfa5e2146b618df149c0bcea4997.zip |
Add build of sqlite3.mjs (ES6 module), add a test app for it, and include it in the dist build.
FossilOrigin-Name: 2e783670e10b59e67c14b0db7f4803b41790cc7730de221d54fa2d4483cfba33
Diffstat (limited to 'ext/wasm/api/extern-post-js.js')
-rw-r--r-- | ext/wasm/api/extern-post-js.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/ext/wasm/api/extern-post-js.js b/ext/wasm/api/extern-post-js.js index fe9e4392b..3dc61ae05 100644 --- a/ext/wasm/api/extern-post-js.js +++ b/ext/wasm/api/extern-post-js.js @@ -1,11 +1,15 @@ + +/* ^^^^ ACHTUNG: blank line at the start is necessary because + Emscripten will not add a newline in some cases and we need + a blank line for a sed-based kludge for the ES6 build. */ /* extern-post-js.js must be appended to the resulting sqlite3.js file. It gets its name from being used as the value for the --extern-post-js=... Emscripten flag. Note that this code, unlike most of the associated JS code, runs outside of the Emscripten-generated module init scope, in the current global scope. */ -//#if SQLITE_JS_ESM -const toexport = +//#if sqlite3-es6-module-build +const toExportForES6 = //#endif (function(){ /** @@ -106,10 +110,10 @@ const toexport = exports["sqlite3InitModule"] = sqlite3InitModule; /* AMD modules get injected in a way we cannot override, so we can't handle those here. */ -//#if SQLITE_JS_ESM +//#if sqlite3-es6-module-build return self.sqlite3InitModule; //#endif })(); -//#if SQLITE_JS_ESM -export default toexport; +//#if sqlite3-es6-module-build +export default toExportForES6; //#endif |