Skip to content

Commit ae6251e

Browse files
adrians5jclaude
andauthored
fix(build): invalidate freshness marker when watch writes dist (#5416)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 158fae9 commit ae6251e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

packages/build-tools/packages/watchPackage.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1+
import fs from "node:fs";
2+
import { join } from "node:path";
3+
14
export default async options => {
25
const { cwd } = options;
36

7+
// Invalidate the build-cache freshness marker (see scripts/buildPackages
8+
// distBuildHash.ts, ".webiny-build-hash"). Watch writes into dist without
9+
// updating that marker, so its contents no longer match the last full
10+
// build — a later `yarn build` must restore/rebuild instead of trusting the
11+
// marker and skipping the cache→dist copy.
12+
fs.rmSync(join(cwd, "dist", ".webiny-build-hash"), { force: true });
13+
414
// Must be a dynamic import — see rslibCompile.js for the reason.
515
const [{ createRslib }, { pluginSvgr }] = await Promise.all([
616
import("@rslib/core"),

0 commit comments

Comments
 (0)