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

Apply considerable acrobatics to get the JS/WASM deliverables building to and loadable from a directory other than the one which contains the app-level code. Requires an only-slightly-leaky abstraction of passing a URL argument when loading sqlite3.js but provides much greater flexibility in where the JS/WASM files are located.

FossilOrigin-Name: 6d468dab9eb84d4548f68014959f02fe4f66455472ff24fe729382bb2972e3d1
This commit is contained in:
stephan
2022-10-19 04:44:58 +00:00
parent 71de8e0241
commit cd0df83c15
27 changed files with 250 additions and 76 deletions

View File

@ -1,6 +1,11 @@
'use strict';
(function(){
importScripts('common/whwasmutil.js','speedtest1.js');
let speedtestJs = 'speedtest1.js';
const urlParams = new URL(self.location.href).searchParams;
if(urlParams.has('sqlite3.dir')){
speedtestJs = urlParams.get('sqlite3.dir') + '/' + speedtestJs;
}
importScripts('common/whwasmutil.js', speedtestJs);
/**
If this environment contains OPFS, this function initializes it and
returns the name of the dir on which OPFS is mounted, else it returns