Repository navigation
chore: clean dist directory before (re-)build - #1945
Merged
Merged
Conversation
mschile
reviewed
Oct 26, 2026
add dist rimraf delete to build script
mschile
approved these changes
Oct 26, 2026
|
🎉 This PR is included in version 7.4.8 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Situation
The utility @vercel/ncc was originally built to "compile a Node.js project into a single file". This can also refer to dependencies.
Changes to transient dependencies caused
nccto create a new chunk, obsoleting an old numbered chunk which was however not purged.Asset relocation is described in https://github.com/vercel/webpack-asset-relocator-loader#how-it-works
Change
Add a new git hookprebuildwhich deletes thedistdirectory before building, using the cross-platform rimraf package.In .github/workflows/check-dist.yml remove thedistdirectory before runningbuildand comparing the output.Modify the
buildscript to delete thedistdirectory before building, using the cross-platform rimraf package.Note
Low Risk
Build-time-only change; runtime action code is unchanged aside from ensuring a clean
dist/artifact on each build.Overview
The
buildscript now runsrimraf distbeforencc build, so each build starts from an empty output folder instead of leaving behind obsoletenccnumbered asset chunks when dependencies change.rimrafis added as a devDependency (with lockfile updates) for cross-platform directory deletion.Reviewed by Cursor Bugbot for commit 6c1560a. Bugbot is set up for automated code reviews on this repo. Configure here.