building and cache breaking with vite#31
Conversation
There was a problem hiding this comment.
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
.jsextensions 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.
…ex.html file never (its small), and cache files like fonts for a little while
|
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. |
|
@flomero Yeah those changes are super cool. Husky seems like black magic, love it. |
PaulicStudios
left a comment
There was a problem hiding this comment.
Other than that the cache thing the changes are pretty nice
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.