Skip to content

Commit

Permalink
Merge pull request #118 from pyscript/fixed-unresolved-config
Browse files Browse the repository at this point in the history
Fixed unresolved config in workers
  • Loading branch information
WebReflection authored Sep 24, 2024
2 parents 92c15b1 + 4d0e83e commit 763fd1d
Show file tree
Hide file tree
Showing 5 changed files with 160 additions and 281 deletions.
2 changes: 1 addition & 1 deletion docs/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.js.map

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions esm/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,17 @@ export const handleCustomType = async (node) => {
const worker = workerURL(node);
if (worker) {
let v = version;
const cfg = node.getAttribute('config') || config || {};
if (!v) {
const [o] = resolveConfig(cfg, configURL);
const details = await o;
v = details.version || details.interpreter;
let url = configURL;
let cfg = node.getAttribute('config') || config || {};
if (!v || !cfg) {
const [o, u] = resolveConfig(cfg, configURL);
cfg = await o;
url = u;
v = cfg.version || cfg.interpreter;
}
const xworker = XW.call(new Hook(null, hooks), worker, {
...nodeInfo(node, type),
configURL,
configURL: url,
version: v,
type: runtime,
custom: type,
Expand Down
Loading

0 comments on commit 763fd1d

Please sign in to comment.