-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathvite.config.js
37 lines (35 loc) · 919 Bytes
/
vite.config.js
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
import FastGlob from 'fast-glob'
import { resolve } from 'node:path'
import tailwindcss from '@tailwindcss/vite'
const reload = {
handleHotUpdate({ file, server }) {
if (!file.includes('temp') && file.endsWith(".php") || file.endsWith(".latte")) {
server.ws.send({
type: 'full-reload',
path: '*',
});
}
}
}
export default {
plugins: [tailwindcss(), reload],
server: {
watch: {
usePolling: true
},
hmr: {
host: 'localhost'
}
},
build: {
manifest: 'manifest.json',
outDir: "www",
emptyOutDir: false,
modulePreload: false,
assetsInlineLimit: 0,
rollupOptions: {
input: FastGlob.sync(['./src/scripts/*.js', './src/styles/*.css'])
.map(entry => resolve(process.cwd(), entry))
}
}
}