fix(web): clean dist before build to prevent stale chunks#318
Conversation
…cumulation rm -rf web/dist before npm run build so old JS chunks don't persist across builds. Also include web/dist in the clean target. Restores the tracked .gitkeep after cleaning.
There was a problem hiding this comment.
Code Review
This pull request updates the Makefile to clean the web/dist directory and recreate the web/dist/client/.gitkeep file during both the web build and clean targets. The reviewer suggests also cleaning the web/public/assets and web/public/shoelace directories in both targets to prevent stale hashed JS/CSS chunks from accumulating and to ensure a completely clean build environment.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| @rm -rf web/dist | ||
| @cd web && npm install && npm run build | ||
| @mkdir -p web/dist/client && touch web/dist/client/.gitkeep |
There was a problem hiding this comment.
While cleaning web/dist prevents stale chunks in the build output directory, the build process also copies assets to web/public/assets and web/public/shoelace (via npm run copy:client and npm run copy:shoelace-icons). Since these directories are not cleaned, stale hashed JS/CSS chunks will still accumulate in web/public/assets over time.
Cleaning these directories before building ensures a completely clean build environment.
@rm -rf web/dist web/public/assets web/public/shoelace
@cd web && npm install && npm run build
@mkdir -p web/dist/client && touch web/dist/client/.gitkeep
| @rm -rf $(BUILD_DIR) .build web/dist | ||
| @mkdir -p web/dist/client && touch web/dist/client/.gitkeep |
There was a problem hiding this comment.
To ensure consistency with the web target and fully clean all generated frontend build artifacts, the clean target should also remove web/public/assets and web/public/shoelace.
@rm -rf $(BUILD_DIR) .build web/dist web/public/assets web/public/shoelace
@mkdir -p web/dist/client && touch web/dist/client/.gitkeep
Summary
rm -rf web/distbeforenpm run buildin thewebMakefile target so stale JS chunks don't accumulate across buildsweb/distin thecleantarget for consistencyweb/dist/client/.gitkeepafter cleaningTest plan
make weband verifyweb/distis cleaned before buildmake cleanand verifyweb/distis removedweb/dist/client/.gitkeepis restored after both targets