mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Rename sqlite3-worker1-bundler-friendly.js to sqlite3-worker1-bundler-friendly.mjs and refactor it to work as an ES6 module, based on feedback in [forum post a255f89c2eadf4c4|forum:a255f89c2eadf4c4].
FossilOrigin-Name: af312b131457743d98b84137bd51d9ba60e0daf0bd8f5a66f05956ca35ab68fb
This commit is contained in:
@@ -31,11 +31,11 @@
|
||||
- `sqlite3.dir`, if set, treats the given directory name as the
|
||||
directory from which `sqlite3.js` will be loaded.
|
||||
*/
|
||||
"use strict";
|
||||
(()=>{
|
||||
//#if target=es6-bundler-friendly
|
||||
importScripts('sqlite3.js');
|
||||
import {default as sqlite3InitModule} from './sqlite3-bundler-friendly.mjs';
|
||||
//#else
|
||||
"use strict";
|
||||
{
|
||||
const urlParams = new URL(self.location.href).searchParams;
|
||||
let theJs = 'sqlite3.js';
|
||||
if(urlParams.has('sqlite3.dir')){
|
||||
@@ -43,8 +43,6 @@
|
||||
}
|
||||
//console.warn("worker1 theJs =",theJs);
|
||||
importScripts(theJs);
|
||||
}
|
||||
//#endif
|
||||
sqlite3InitModule().then((sqlite3)=>{
|
||||
sqlite3.initWorker1API();
|
||||
});
|
||||
})();
|
||||
sqlite3InitModule().then(sqlite3 => sqlite3.initWorker1API());
|
||||
|
Reference in New Issue
Block a user