Skip to content

Commit df6371b

Browse files
Stabilize webpack cache name variant
Use path.basename(sourceBuildDir || outdir) in cache.name to avoid including environment-specific absolute paths, keeping cache keys consistent across local and CI builds.
1 parent 4e0e3a7 commit df6371b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

build.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,12 @@ async function runWebpack(isWithoutKatex, isWithoutTiktoken, minimal, sourceBuil
8888
sassImpl = mod.default || mod
8989
}
9090

91+
const dirKey = path.basename(sourceBuildDir || outdir)
9192
const variantId = [
9293
isWithoutKatex ? 'no-katex' : 'with-katex',
9394
isWithoutTiktoken ? 'no-tiktoken' : 'with-tiktoken',
9495
minimal ? 'minimal' : 'full',
95-
sourceBuildDir || outdir,
96+
dirKey,
9697
isProduction ? 'prod' : 'dev',
9798
].join('|')
9899

0 commit comments

Comments
 (0)