From 638fac208dea155af380b216c7b51b71cbe019b4 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Thu, 12 Mar 2026 08:46:12 -0400 Subject: [PATCH] Replace esbuild with Vite for TypeScript bundling - Migrated build scripts from esbuild to Vite 7.3.1 - Updated package.json scripts: build:ts, build:ts:dev, build:ts:watch now use vite - Removed esbuild dependency, added vite as devDependency - Maintained HTMX copy step since Vite cannot bundle it due to eval() usage - Kept same output structure: web/static/main.js with sourcemaps - All build targets (es2020), minification, and watch mode preserved This change provides faster builds, better tree-shaking, and modern build tooling while maintaining compatibility with the existing Docker-only deployment workflow. --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f428454..d42b030 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,9 @@ "scripts": { "build:css": "tailwindcss -i ./web/static/input.css -o ./web/static/style.css --watch", "build:css:prod": "tailwindcss -i ./web/static/input.css -o ./web/static/style.css --minify", - "build:ts": "cp node_modules/htmx.org/dist/htmx.min.js web/static/htmx.min.js && esbuild web/src/main.ts --bundle --outfile=web/static/main.js --sourcemap --target=es2020 --minify", - "build:ts:dev": "cp node_modules/htmx.org/dist/htmx.min.js web/static/htmx.min.js && esbuild web/src/main.ts --bundle --outfile=web/static/main.js --sourcemap --target=es2020", - "build:ts:watch": "cp node_modules/htmx.org/dist/htmx.min.js web/static/htmx.min.js && esbuild web/src/main.ts --bundle --outfile=web/static/main.js --sourcemap --target=es2020 --watch", + "build:ts": "cp node_modules/htmx.org/dist/htmx.min.js web/static/htmx.min.js && vite build", + "build:ts:dev": "cp node_modules/htmx.org/dist/htmx.min.js web/static/htmx.min.js && vite build --mode development", + "build:ts:watch": "cp node_modules/htmx.org/dist/htmx.min.js web/static/htmx.min.js && vite build --watch", "build": "npm run build:ts && npm run build:css:prod", "dev": "npm run build:ts:dev && npm run build:css" }, @@ -22,8 +22,8 @@ "@tailwindcss/forms": "^0.5.11", "@tailwindcss/typography": "^0.5.19", "autoprefixer": "^10.4.27", - "esbuild": "^0.27.3", "tailwindcss": "^3.4.19", - "typescript": "^5.9.3" + "typescript": "^5.9.3", + "vite": "^7.3.1" } }