Skip to content

Commit

Permalink
fix: skip import map for pipe loading
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNoim committed May 30, 2024
1 parent f27ec1a commit 0c5fcc1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 9 additions & 1 deletion reactive_home/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,13 @@ fi

deno run --lock=/deno.lock --allow-read=/config/reactive-home/import_map.json,/config.yaml --allow-write=/config/reactive-home/import_map.json /update-import-map.ts


PKG_VERSION_SCRIPT="
import file from '/config/reactive-home/import_map.json' with { type: 'json' };
console.log(file.imports['reactive-home'])
"

PKG_VERSION=$(echo "$PKG_VERSION_SCRIPT" | deno run -)

echo "Load runtime..."
echo "import 'reactive-home/runtime'" | deno run --import-map=/config/reactive-home/import_map.json --allow-env --allow-net --allow-run --allow-sys --allow-read - --root /config/reactive-home
echo "import '$PKG_VERSION/runtime'" | deno run --import-map=/config/reactive-home/import_map.json --allow-env --allow-net --allow-run --allow-sys --allow-read - --root /config/reactive-home --pkg "$PKG_VERSION"
6 changes: 4 additions & 2 deletions src/runtime/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { join, basename } from "@std/path";
import { parseArgs as parse } from "@std/cli";

const flags = parse(Deno.args, {
string: ["root"],
string: ["root", "pkg"],
boolean: ["local-test"],
});

Expand Down Expand Up @@ -45,7 +45,9 @@ async function executeScripts(abort: AbortSignal) {
await writer.write(
new TextEncoder().encode(
`import "${
flags["local-test"] ? "./src/runtime/loader.ts" : "reactive-home/loader"
flags["local-test"]
? "./src/runtime/loader.ts"
: `${flags.pkg ?? "reactive-home"}/loader`
}";`
)
);
Expand Down

0 comments on commit 0c5fcc1

Please sign in to comment.