1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Beginnings of a bundler-friendly build of sqlite3.mjs. Not yet ready for downstream testing.

FossilOrigin-Name: 4271bf5f41df091696f1dcfc4ffe7a60d24066fc75c896941e0b56de95fe5f89
This commit is contained in:
stephan
2023-01-27 01:33:12 +00:00
parent 0945197a39
commit 0cd38cd2b9
7 changed files with 98 additions and 39 deletions

View File

@ -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