This commit is contained in:
Seth Trowbridge 2023-06-21 17:32:10 -04:00
parent 55b5bd28ab
commit a9139c6cd3
8 changed files with 11 additions and 8 deletions

View File

@ -1,4 +1,4 @@
import "../serve.tsx"; import "./run-serve.tsx";
Deno.args.forEach(arg=> Deno.args.forEach(arg=>
{ {
@ -11,5 +11,5 @@ Deno.args.forEach(arg=>
if(Deno.env.get("dev")) if(Deno.env.get("dev"))
{ {
await import("../local.tsx"); await import("./run-local.tsx");
} }

View File

@ -7,7 +7,7 @@
{ {
"react":"https://esm.sh/preact@10.15.1/compat", "react":"https://esm.sh/preact@10.15.1/compat",
"react-original":"https://esm.sh/preact@10.15.1/compat", "react-original":"https://esm.sh/preact@10.15.1/compat",
"@able/": "./_lib_/" "@able/": "./"
}, },
"tasks": "tasks":
{ {

View File

@ -3,7 +3,7 @@
"imports": "imports":
{ {
"react":"https://esm.sh/preact@10.15.1/compat", "react":"https://esm.sh/preact@10.15.1/compat",
"@able/":"http://localhost:4507/_lib_/" "@able/":"http://localhost:4507/"
}, },
"tasks": "tasks":
{ {

View File

@ -1,4 +1,4 @@
import {Configure, Transpile, Extension} from "./serve.tsx"; import {Configure, Transpile, Extension} from "./run-serve.tsx";
const SocketsLive:Set<WebSocket> = new Set(); const SocketsLive:Set<WebSocket> = new Set();
const SocketsSend =(inData:string)=>{ console.log(inData); for (const socket of SocketsLive){ socket.send(inData); } } const SocketsSend =(inData:string)=>{ console.log(inData); for (const socket of SocketsLive){ socket.send(inData); } }

View File

@ -194,14 +194,17 @@ HTTP.serve(async(req: Request)=>
let path; let path;
if(url.pathname.startsWith("/_lib_/")) if(url.pathname.startsWith("/_lib_/"))
{ {
if(url.pathname.startsWith("/_lib_/boot")) const clipRoot = import.meta.url.substring(0, import.meta.url.lastIndexOf("/"));
const clipPath = url.pathname.substring(url.pathname.indexOf("/", 1));
if(clipPath.startsWith("/boot-"))
{ {
path = import.meta.url+"/../_lib_/boot-browser.tsx"; path = clipRoot+"/boot-browser.tsx";
} }
else else
{ {
path = import.meta.url+"/.."+url.pathname; path = clipRoot + clipPath;
} }
console.log("transpiling", path);
code = await Transpile.Fetch(path, url.pathname, true); code = await Transpile.Fetch(path, url.pathname, true);
} }
else else