fix: properly bundle and cache frontend assets
- Build frontend assets natively with Bun to dist/public/ via `src/index.html` entrypoint - Serve static assets in production with `Cache-Control: public, max-age=31536000, immutable` caching headers - Preserve native `bun run dev` routing for seamless HMR by retaining development mode conditions in the server router - Exclude `index.html` from long-term cache headers to allow for production updates
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "bun --hot src/server.tsx",
|
||||
"build": "rm -rf dist && bun build --target=bun ./src/server.tsx --outdir ./dist",
|
||||
"build": "rm -rf dist && bun build --minify --target=browser ./src/index.html --outdir ./dist/public && bun build --target=bun ./src/server.tsx --outdir ./dist",
|
||||
"start": "cd dist && DATABASE_PATH=../data/excalidraw.sqlite bun ./server.js",
|
||||
"test": "bun test",
|
||||
"typecheck": "tsc --noEmit"
|
||||
|
||||
Reference in New Issue
Block a user