fix: add missing compile entry (#3410)
Fixes https://github.com/denoland/fresh/issues/3409
This commit is contained in:
@@ -381,15 +381,7 @@ export class DiskBuildCache<State> implements DevBuildCache<State> {
|
||||
}),
|
||||
);
|
||||
|
||||
await Deno.writeTextFile(
|
||||
path.join(outDir, "compiled-entry.js"),
|
||||
`import fetcher from "./server.js";
|
||||
|
||||
Deno.serve(
|
||||
{ port: Deno.env.get("PORT"), hostname: Deno.env.get("HOSTNAME") },
|
||||
fetcher.fetch
|
||||
);`,
|
||||
);
|
||||
await writeCompiledEntry(outDir);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -425,6 +417,18 @@ export interface PendingStaticFile {
|
||||
hash: string | null;
|
||||
}
|
||||
|
||||
export async function writeCompiledEntry(outDir: string) {
|
||||
await Deno.writeTextFile(
|
||||
path.join(outDir, "compiled-entry.js"),
|
||||
`import fetcher from "./server.js";
|
||||
|
||||
Deno.serve(
|
||||
{ port: Deno.env.get("PORT"), hostname: Deno.env.get("HOSTNAME") },
|
||||
fetcher.fetch
|
||||
);`,
|
||||
);
|
||||
}
|
||||
|
||||
export async function generateSnapshotServer(
|
||||
options: {
|
||||
outDir: string;
|
||||
|
||||
Reference in New Issue
Block a user