feat: prebundle code + restore from snapshot (#1604)
This commit is contained in:
+12
-2
@@ -11,6 +11,8 @@ import {
|
||||
WalkEntry,
|
||||
} from "./deps.ts";
|
||||
import { error } from "./error.ts";
|
||||
import { FreshOptions } from "../server/mod.ts";
|
||||
import { build } from "./build.ts";
|
||||
|
||||
const MIN_DENO_VERSION = "1.31.0";
|
||||
|
||||
@@ -183,7 +185,11 @@ export default manifest;
|
||||
);
|
||||
}
|
||||
|
||||
export async function dev(base: string, entrypoint: string) {
|
||||
export async function dev(
|
||||
base: string,
|
||||
entrypoint: string,
|
||||
options: FreshOptions = {},
|
||||
) {
|
||||
ensureMinDenoVersion();
|
||||
|
||||
// Run update check in background
|
||||
@@ -209,7 +215,11 @@ export async function dev(base: string, entrypoint: string) {
|
||||
|
||||
if (manifestChanged) await generate(dir, newManifest);
|
||||
|
||||
await import(entrypoint);
|
||||
if (Deno.args.includes("build")) {
|
||||
await build(join(dir, "fresh.gen.ts"), options);
|
||||
} else {
|
||||
await import(entrypoint);
|
||||
}
|
||||
}
|
||||
|
||||
function arraysEqual<T>(a: T[], b: T[]): boolean {
|
||||
|
||||
Reference in New Issue
Block a user