This commit is contained in:
Rizky 2024-02-15 06:45:58 +07:00
parent 7d76160943
commit ff6efc0518
9 changed files with 10 additions and 8 deletions

View File

@ -59,7 +59,7 @@ export const _ = {
code.path(site_id, "server", "build") code.path(site_id, "server", "build")
), ),
site: readDirectoryRecursively(code.path(site_id, "site", "build")), site: readDirectoryRecursively(code.path(site_id, "site", "build")),
core: readDirectoryRecursively(dir.path(`/app/srv/prod`)), core: readDirectoryRecursively(dir.path(`/app/srv/core`)),
}, },
}; };

View File

@ -148,7 +148,7 @@ export const _ = {
} else if (pathname === "index.html" || pathname === "_") { } else if (pathname === "index.html" || pathname === "_") {
return index_html; return index_html;
} else { } else {
const res = dir.path(`/app/srv/prod/${pathname}`); const res = dir.path(`/app/srv/core/${pathname}`);
const file = Bun.file(res); const file = Bun.file(res);
if (!(await file.exists())) { if (!(await file.exists())) {
return index_html; return index_html;

File diff suppressed because one or more lines are too long

View File

@ -23,7 +23,9 @@ export const base = {
} }
}, },
get pathname() { get pathname() {
return location.pathname.substring(base.root.pathname.length); const res = location.pathname.substring(base.root.pathname.length);
if (!res.startsWith("/")) return `/${res}`;
return res;
}, },
site: { id: w._prasi?.site_id } as { site: { id: w._prasi?.site_id } as {
id: string; id: string;

View File

@ -55,7 +55,7 @@ export const Root = () => {
const page = router.lookup(base.pathname); const page = router.lookup(base.pathname);
if (!page) return <DeadEnd>Page Not Found</DeadEnd>; if (!page) return <DeadEnd>Page Not Found</DeadEnd>;
w.params = page.params; w.params = page.params || {};
base.page.id = page.id; base.page.id = page.id;
base.page.url = page.url; base.page.url = page.url;

BIN
dockerzip

Binary file not shown.

View File

@ -5,7 +5,7 @@ const ctx = await context({
bundle: true, bundle: true,
absWorkingDir: dir.path(""), absWorkingDir: dir.path(""),
entryPoints: [dir.path("app/web/src/nova/prod/main.tsx")], entryPoints: [dir.path("app/web/src/nova/prod/main.tsx")],
outdir: dir.path(`/app/srv/prod`), outdir: dir.path(`/app/srv/core`),
splitting: true, splitting: true,
format: "esm", format: "esm",
jsx: "transform", jsx: "transform",

View File

@ -71,6 +71,8 @@ if (!g.apiPrepared) {
} }
} }
if (g.mode === "dev") await import("./build-core");
if (!g.parcel) { if (!g.parcel) {
await parcelBuild(); await parcelBuild();
} }

View File

@ -34,8 +34,6 @@ if (!g.dockerPrepared) {
}, },
}; };
await import("./core/build-prod");
if (!(await existsAsync(dir.path("_tmp_docker")))) { if (!(await existsAsync(dir.path("_tmp_docker")))) {
for (const file of Object.keys(dir.read(dir.path``))) { for (const file of Object.keys(dir.read(dir.path``))) {
if ( if (