From 8e1e01e56d2599687655825cbad36a164ebbea21 Mon Sep 17 00:00:00 2001 From: webreflection Date: Fri, 15 Dec 2023 13:43:44 +0100 Subject: [PATCH] Fix #70 - Use the config base URL to resolve modules --- docs/README.md | 6 ++++++ docs/core.js | 4 ++-- docs/core.js.map | 2 +- esm/interpreter/_utils.js | 7 +++++-- esm/interpreters.js | 4 ++++ esm/worker/_template.js | 6 ++++-- index.html | 1 + package.json | 2 +- test/index.js | 3 +++ test/modules.html | 7 +++++-- test/modules.js | 1 + test/modules.toml | 1 + 12 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 test/modules.js diff --git a/docs/README.md b/docs/README.md index dd105f5..91ad930 100644 --- a/docs/README.md +++ b/docs/README.md @@ -266,6 +266,8 @@ In *polyscript*, this is possible by defining one or more `[js_modules.X]` field ### js_modules config example +**TOML** + ```toml [js_modules.main] # this modules work best on main @@ -281,6 +283,8 @@ In *polyscript*, this is possible by defining one or more `[js_modules.X]` field "https://cdn.jsdelivr.net/npm/worker-only" = "worker_only" ``` +**JSON** + ```js { "js_modules": { @@ -297,6 +301,8 @@ In *polyscript*, this is possible by defining one or more `[js_modules.X]` field } ``` +**Python** + ```html