-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathvite.config.js
More file actions
48 lines (46 loc) · 1.49 KB
/
vite.config.js
File metadata and controls
48 lines (46 loc) · 1.49 KB
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 tailwindcss from '@tailwindcss/vite'
import { fileURLToPath } from 'node:url'
export default defineConfig({
root: '.',
plugins: [
tailwindcss(),
],
server: {
watch: {
ignored: ['**/webroot/**', '**/vendor/**', '**/tmp/**', '**/logs/**'],
},
},
resolve: {
conditions: ['module', 'browser', 'development', 'import'],
alias: {
'slim-select/styles': fileURLToPath(new URL('./node_modules/slim-select/dist/slimselect.css', import.meta.url))
}
},
build: {
outDir: 'webroot',
emptyOutDir: false,
rollupOptions: {
input: {
cake: 'resources/css/style.css',
app: 'resources/js/app.js',
},
onLog(level, log, handler) {
// Suppress EVAL warning from htmx (known limitation, safe in this context)
if (log.code === 'EVAL' && log.id?.includes('htmx')) {
return
}
handler(level, log)
},
output: {
entryFileNames: (chunkInfo) => chunkInfo.name === 'app' ? 'js/app.js' : 'js/[name].js',
assetFileNames: (assetInfo) => {
if (assetInfo.names.includes('cake.css')) {
return 'css/cake.css';
}
return 'assets/[name][extname]';
},
},
},
},
})