Skip to content

fix(web): clean dist before build to prevent stale chunks#318

Open
ptone wants to merge 1 commit into
mainfrom
scion/web-build-clean-dev
Open

fix(web): clean dist before build to prevent stale chunks#318
ptone wants to merge 1 commit into
mainfrom
scion/web-build-clean-dev

Conversation

@ptone

@ptone ptone commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds rm -rf web/dist before npm run build in the web Makefile target so stale JS chunks don't accumulate across builds
  • Includes web/dist in the clean target for consistency
  • Restores the tracked web/dist/client/.gitkeep after cleaning

Test plan

  • Run make web and verify web/dist is cleaned before build
  • Run make clean and verify web/dist is removed
  • Verify web/dist/client/.gitkeep is restored after both targets

…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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Makefile
Comment on lines +89 to +91
@rm -rf web/dist
@cd web && npm install && npm run build
@mkdir -p web/dist/client && touch web/dist/client/.gitkeep

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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

Comment thread Makefile
Comment on lines +154 to +155
@rm -rf $(BUILD_DIR) .build web/dist
@mkdir -p web/dist/client && touch web/dist/client/.gitkeep

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant