Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.

building and cache breaking with vite#31

Merged
FreddyMSchubert merged 14 commits intodevfrom
30-building-and-cache-breaking
Aug 19, 2025
Merged

building and cache breaking with vite#31
FreddyMSchubert merged 14 commits intodevfrom
30-building-and-cache-breaking

Conversation

@FreddyMSchubert
Copy link
Member

Removed http-server dev webserver and ts for building packages, replaced both with vite which also now does bundling with solid file hashing for client cache breaking. It works. Also the second time I've done it like this though, so @flomero all feedback is super welcome please.
@PaulicStudios had to change the build setup so I marked you as well. Only one line though, everything should still work I believe.

@FreddyMSchubert FreddyMSchubert self-assigned this Aug 18, 2025
@FreddyMSchubert FreddyMSchubert linked an issue Aug 18, 2025 that may be closed by this pull request
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates the build system from TypeScript compilation with http-server to Vite, enabling modern bundling with file hashing for cache invalidation and simplified development workflow.

  • Replaced TypeScript + http-server development setup with Vite for both dev server and building
  • Updated all import statements to remove .js extensions for better Vite compatibility
  • Modified package scripts and dependencies to use Vite instead of separate TypeScript compilation

Reviewed Changes

Copilot reviewed 9 out of 46 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
vite.config.ts New Vite configuration with build output and dev server settings
package.json Updated scripts to use Vite commands and replaced dependencies
index.html Changed script sources to point to TypeScript files instead of compiled JS
Dockerfile Updated build output path from src/public to dist
Multiple .ts files Removed .js extensions from import statements for Vite compatibility

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@FreddyMSchubert
Copy link
Member Author

Now all the cash-breaking-handled files like css and js files will be cached indefinitely, and the index.html will never be cached. I think this is fine as index.html is tiny and like this we guarantee users always have the latest version immediately after deployment.

@FreddyMSchubert
Copy link
Member Author

@flomero Yeah those changes are super cool. Husky seems like black magic, love it.
Removed prettierrc as its not needed anymore now. And I don't think lint-staged works right now, how would it know how to pass the arguments through npm run fix? Adding file arguments behind that wont do anything as far as I can see. Please fix the lint-staged config beyond that awesome, thank you, let's merge.
But let's keep this on dev for now, we shouldn't merge into main again until after the rush evals and tournament are over.

Copy link
Member

@PaulicStudios PaulicStudios left a comment

Choose a reason for hiding this comment

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

Other than that the cache thing the changes are pretty nice

@FreddyMSchubert FreddyMSchubert merged commit 0086fe3 into dev Aug 19, 2025
4 checks passed
@FreddyMSchubert FreddyMSchubert deleted the 30-building-and-cache-breaking branch August 19, 2025 07:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bundling & cache breaking

3 participants