diff --git a/example/deno.jsonc b/example/deno.jsonc index 521187d..a2987a8 100644 --- a/example/deno.jsonc +++ b/example/deno.jsonc @@ -1,13 +1,7 @@ { "compilerOptions": {"lib": ["deno.window", "dom"]}, - "imports": - { - "react": "https://esm.sh/stable/preact@10.13.2/compat", - "preact": "https://esm.sh/stable/preact@10.13.2/", - "@deep/": "./deep/", - "@eno/iso": "http://localhost:4507/lib/iso.tsx" - }, + "importMap": "./deno.map.json", "tasks": { - "dev": "deno run -A --unstable --reload=http://localhost:4507/ --no-lock app.tsx" + "dev": "deno run -A --unstable --reload=http://localhost:4507/ --no-lock app.tsx --dev" } } \ No newline at end of file diff --git a/example/deno.map.json b/example/deno.map.json new file mode 100644 index 0000000..78c923b --- /dev/null +++ b/example/deno.map.json @@ -0,0 +1,10 @@ +{ + "imports": + { + "react": "https://esm.sh/stable/preact@10.13.2/compat", + "preact": "https://esm.sh/stable/preact@10.13.2/", + "@deep/": "./deep/", + "@eno/iso": "http://localhost:4507/lib/iso.tsx", + "@eno/app": "./app.tsx" + } +} \ No newline at end of file diff --git a/server.tsx b/server.tsx index b78c30b..6b78f23 100644 --- a/server.tsx +++ b/server.tsx @@ -256,19 +256,13 @@ export function Boot(inApp:React.FunctionComponent, inCSS?:object) if(Booted){return;} Booted = true; - const pathInit = Deno.mainModule; - const pathProj = toFileUrl(Deno.cwd()); - //@ts-ignore TwindInst = Twind.install({...Iso.CSS, ...inCSS||{}}); - const App = inApp; - Path.AppDir = pathInit.split(pathProj.toString())[1]; - - Server(App, Path.AppDir, TwindInst); + Server(inApp, TwindInst); } -async function Server(App:React.FunctionComponent, AppPath:string, TwindInst:Twind.Twind) +async function Server(App:React.FunctionComponent, TwindInst:Twind.Twind) { const {Transpileable, TranspileURL, SocketsHandler} = Transpiler(DevMode); const {Imports, Error} = await Configure(DevMode, Path.LibDir); @@ -386,7 +380,7 @@ async function Server(App:React.FunctionComponent, AppPath:string, TwindInst:Twi import {Fetch} from "@eno/iso"; Fetch.Seed(${JSON.stringify(seed)}); - import "${AppPath}"; + import "@eno/app"; `;