clusev/vite.config.js

44 lines
1.4 KiB
JavaScript

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import tailwindcss from '@tailwindcss/vite';
export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js'],
refresh: true,
}),
tailwindcss(),
],
server: {
// Bind all interfaces inside the container; the browser reaches the VM.
host: '0.0.0.0',
port: 5173,
strictPort: true,
cors: true,
// Remote HMR: hot file + websocket point at the dev VM, not 0.0.0.0/localhost. The host is
// env-driven (VITE_HMR_HOST) so no private/internal address is committed or baked into the
// shipped image; set it in the dev .env only. Dev-only — prod builds assets, no HMR server.
hmr: {
host: process.env.VITE_HMR_HOST || 'localhost',
},
// The repo is rooted in $HOME — keep the watcher off heavy/irrelevant trees.
watch: {
ignored: [
'**/vendor/**',
'**/node_modules/**',
'**/storage/**',
'**/.git/**',
'**/.cache/**',
'**/.npm/**',
'**/.vscode-server/**',
'**/.dotnet/**',
'**/.composer/**',
'**/.config/**',
'**/.claude/**',
'**/.local/**',
],
},
},
});