aboutsummaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2024-01-11 18:25:46 +0000
committerLouis Pilfold <louis@lpil.uk>2024-01-11 18:25:53 +0000
commit29da9b51c0d918b86108bdbf0f4c6e914b240283 (patch)
treeafa831fdbb906c21cbc52cb89bcfc9488328eb89 /static
parent8283226cf4cf15480167a7d71d432a87bff0d07b (diff)
downloadtour-29da9b51c0d918b86108bdbf0f4c6e914b240283.tar.gz
tour-29da9b51c0d918b86108bdbf0f4c6e914b240283.zip
Advanced features
Diffstat (limited to 'static')
-rw-r--r--static/index.js3
-rw-r--r--static/precompiled/my_package_ffi.mjs3
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();
+}