summaryrefslogtreecommitdiffhomepage
path: root/vite.config.ts
diff options
context:
space:
mode:
Diffstat (limited to 'vite.config.ts')
-rw-r--r--vite.config.ts37
1 files changed, 37 insertions, 0 deletions
diff --git a/vite.config.ts b/vite.config.ts
new file mode 100644
index 0000000..1f8d5b5
--- /dev/null
+++ b/vite.config.ts
@@ -0,0 +1,37 @@
+import { defineConfig } from 'vite'
+import react from '@vitejs/plugin-react'
+import tailwindcss from '@tailwindcss/vite'
+
+// https://vite.dev/config/
+export default defineConfig({
+ plugins: [
+ react(),
+ tailwindcss(),
+ ],
+
+ // --- Dev-server settings (important for Docker) ---
+ server: {
+ // Bind to all interfaces so the app is reachable from outside the
+ // container (other PCs on the LAN, or the Docker host itself).
+ host: true,
+
+ // Allow specific hostnames (useful when accessing the dev server via
+ // a machine name on the LAN such as "arch-razer").
+ // Vite's `host: true` already binds to all interfaces; this explicit
+ // whitelist helps documentation and tooling that may inspect the config.
+ allowedHosts: ['arch-razer'],
+
+ // Explicitly set the port (must match the EXPOSE in Dockerfile).
+ port: 5173,
+
+ // Use polling for file-change detection. Filesystem events (inotify)
+ // do not propagate reliably across Docker bind-mounts, so Vite/
+ // chokidar must fall back to polling. The interval (in ms) controls
+ // how frequently it checks — 100 ms is a good balance between
+ // responsiveness and CPU usage.
+ watch: {
+ usePolling: true,
+ interval: 100,
+ },
+ },
+})