Enable HMR for the webview, complements of vite

This commit is contained in:
cte
2025-01-30 16:25:13 -08:00
parent a5dac3f0a1
commit 97367951a2
6 changed files with 547 additions and 67 deletions

31
webview-ui/vite.config.ts Normal file
View File

@@ -0,0 +1,31 @@
import path from "path"
import { defineConfig } from "vite"
import react from "@vitejs/plugin-react"
import tailwindcss from "@tailwindcss/vite"
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), tailwindcss()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
build: {
outDir: "build",
rollupOptions: {
output: {
entryFileNames: `assets/[name].js`,
chunkFileNames: `assets/[name].js`,
assetFileNames: `assets/[name].[ext]`,
},
},
},
server: {
hmr: {
host: "localhost",
protocol: "ws",
},
},
})