diff options
Diffstat (limited to 'static')
-rw-r--r-- | static/index.js | 3 | ||||
-rw-r--r-- | static/precompiled/my_package_ffi.mjs | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/static/index.js b/static/index.js index cfe026c..b6f2754 100644 --- a/static/index.js +++ b/static/index.js @@ -77,8 +77,9 @@ async function loadProgram(js) { const href = url.toString(); const js1 = js.replaceAll( /from\s+"\.\/(.+)"/g, - `from "${href}precompiled/$1"` + `from "${href}precompiled/$1"`, ); + console.log(js1); const js2 = btoa(unescape(encodeURIComponent(js1))); const module = await import("data:text/javascript;base64," + js2); return module.main; diff --git a/static/precompiled/my_package_ffi.mjs b/static/precompiled/my_package_ffi.mjs new file mode 100644 index 0000000..3c8e2f8 --- /dev/null +++ b/static/precompiled/my_package_ffi.mjs @@ -0,0 +1,3 @@ +export function now() { + return new Date(); +} |