Skip to content

Commit b582c57

Browse files
authored
refactor(core): use getSnapshotPath() (#2873)
1 parent cfa7fdc commit b582c57

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/build_cache.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as path from "@std/path";
2-
import type { ResolvedFreshConfig } from "./config.ts";
2+
import { getSnapshotPath, type ResolvedFreshConfig } from "./config.ts";
33
import { DENO_DEPLOYMENT_ID, setBuildId } from "./runtime/build_id.ts";
44
import * as colors from "@std/fmt/colors";
55

@@ -30,7 +30,7 @@ export interface BuildCache {
3030

3131
export class ProdBuildCache implements BuildCache {
3232
static async fromSnapshot(config: ResolvedFreshConfig, islandCount: number) {
33-
const snapshotPath = path.join(config.build.outDir, "snapshot.json");
33+
const snapshotPath = getSnapshotPath(config);
3434

3535
const staticFiles = new Map<string, FileSnapshot>();
3636
const islandToChunk = new Map<string, string>();

src/dev/dev_build_cache.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { BuildCache, StaticFile } from "../build_cache.ts";
22
import * as path from "@std/path";
33
import { SEPARATOR as WINDOWS_SEPARATOR } from "@std/path/windows/constants";
4-
import type { ResolvedFreshConfig } from "../config.ts";
4+
import { getSnapshotPath, type ResolvedFreshConfig } from "../config.ts";
55
import type { BuildSnapshot } from "../build_cache.ts";
66
import { encodeHex } from "@std/encoding/hex";
77
import { crypto } from "@std/crypto";
@@ -284,7 +284,7 @@ export class DiskBuildCache implements DevBuildCache {
284284
}
285285

286286
await Deno.writeTextFile(
287-
path.join(this.config.build.outDir, "snapshot.json"),
287+
getSnapshotPath(this.config),
288288
JSON.stringify(snapshot, null, 2),
289289
);
290290
}

0 commit comments

Comments
 (0)