@samitouri / QOS-React / commits / 1b7ae3a142

[scripts] Fix release channel artifact cleanup for local builds (#36859)

Co-authored-by: Sebastian Sebbie Silbermann <sebastian.silbermann@vercel.com>

Minh Vu committed Jun 25, 2026 at 10:42 UTC 1b7ae3a142cd9f798ad9a89ed21ae058cfebe531
1 file changed +10 -1
scripts/rollup/build-all-release-channels.js
+10 -1
@@ -372,6 +372,12 @@ function processExperimental(buildDir, version) {
372 if (fs.existsSync(buildDir + '/sizes')) {
373 fs.renameSync(buildDir + '/sizes', buildDir + '/sizes-experimental');
374 }
375 + if (fs.existsSync(buildDir + '/bundle-sizes.json')) {
376 + fs.renameSync(
377 + buildDir + '/bundle-sizes.json',
378 + buildDir + '/bundle-sizes-experimental.json'
379 + );
380 + }
381
382 // Delete all other artifacts that weren't handled above. We assume they are
383 // duplicates of the corresponding artifacts in the stable channel. Ideally,
@@ -383,7 +389,10 @@ function processExperimental(buildDir, version) {
389 pathName !== 'facebook-www' &&
390 pathName !== 'sizes-experimental'
391 ) {
386 - spawnSync('rm', ['-rm', buildDir + '/' + pathName]);
392 + fs.rmSync(path.join(buildDir, pathName), {
393 + recursive: true,
394 + force: true,
395 + });
396 }
397 }
398 }