-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
48 lines (42 loc) · 935 Bytes
/
vite.config.js
File metadata and controls
48 lines (42 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { defineConfig } from 'vite'
import ViteRestart from 'vite-plugin-restart'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig(({ command }) => ({
base: command === 'serve' ? '' : '/dist/',
build: {
emptyOutDir: true,
manifest: true,
outDir: 'web/dist/',
sourcemap: true,
rollupOptions: {
input: {
app: 'src/js/app.js',
},
},
},
plugins: [
tailwindcss(),
ViteRestart({
restart: ['templates/**/*.twig'],
delay: 100,
}),
],
publicDir: './src/public',
server: {
allowedHosts: true,
cors: {
origin:
/https?:\/\/([A-Za-z0-9\-\.]+)?(localhost|\.local|\.test|\.site)(?::\d+)?$/,
},
fs: {
strict: false,
},
headers: {
'Access-Control-Allow-Private-Network': 'true',
},
host: '0.0.0.0',
origin: 'http://localhost:3000',
port: 3000,
strictPort: true,
},
}))