From a62e4062a2d78e4519d23a714dd0636624b8cb13 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Thu, 12 Mar 2026 08:46:16 -0400 Subject: [PATCH] Add Vite configuration for TypeScript bundling Created vite.config.ts with optimized settings for the Bookhoard project: - Output directory: web/static/ (matches existing esbuild setup) - Single entry point: web/src/main.ts - Output file: main.js (preserves existing template references) - ES2020 target for modern browser compatibility - Source maps enabled for debugging - esbuild minification for optimal bundle size - emptyOutDir: false to preserve other static assets (htmx.min.js, CSS, images) Configuration maintains the same build output structure as esbuild, ensuring no changes needed to templates or deployment process. --- vite.config.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 vite.config.ts diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..07324f1 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,16 @@ +import { defineConfig } from "vite"; +export default defineConfig({ + build: { + outDir: "web/static", + emptyOutDir: false, + rollupOptions: { + input: "web/src/main.ts", + output: { + entryFileNames: "main.js", + }, + }, + target: "es2020", + sourcemap: true, + minify: "esbuild", + }, +});