Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit d4efff8

Browse files
committed
Fix build cache failure in prod mode
1 parent 0b31a11 commit d4efff8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

server/aleph.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ export class Aleph implements IAleph {
134134
const apiDir = join(srcDir, 'api')
135135
const pagesDir = join(srcDir, 'pages')
136136
const manifestFile = join(this.#buildDir, 'build.manifest.json')
137+
const { browsers, target: buildTarget } = this.#config.build
138+
const buildBrowsers = Object.keys(browsers).sort().map(key => key + ':' + (browsers as any)[key]).join(' ')
137139

138140
// remove the existent build dir when the compiler is updated,
139141
// or using a different aleph version, or build for different target/browsers.
@@ -146,8 +148,8 @@ export class Aleph implements IAleph {
146148
v.compiler !== wasmChecksum ||
147149
v.aleph !== VERSION ||
148150
(this.mode === 'production' && (
149-
v.buildTarget !== this.#config.build.target ||
150-
v.buildBrowsers !== this.#config.build.browsers
151+
v.buildTarget !== buildTarget ||
152+
v.buildBrowsers !== buildBrowsers
151153
))
152154
)
153155
) {
@@ -163,8 +165,8 @@ export class Aleph implements IAleph {
163165
aleph: VERSION,
164166
deno: Deno.version.deno,
165167
compiler: wasmChecksum,
166-
buildTarget: this.#config.build.target,
167-
buildBrowsers: this.#config.build.browsers
168+
buildTarget,
169+
buildBrowsers,
168170
}, undefined, 2))
169171

170172
// load .env[.*] files

0 commit comments

Comments
 (0)