-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
27 lines (26 loc) · 801 Bytes
/
Copy pathvite.config.ts
File metadata and controls
27 lines (26 loc) · 801 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
import { defineConfig } from 'vite';
import tailwindcss from '@tailwindcss/vite';
import path from 'path';
export default defineConfig({
plugins: [tailwindcss()],
root: 'src/web/public',
build: {
outDir: 'dist',
emptyOutDir: true,
rollupOptions: {
input: {
app: path.resolve(__dirname, 'src/web/public/js/app.ts'),
},
output: {
entryFileNames: '[name].js',
chunkFileNames: '[name]-[hash].js',
assetFileNames: (assetInfo) => {
// Ensure CSS from Tailwind has a predictable filename so server templates can link to it
const ext = assetInfo.name ? path.extname(assetInfo.name) : '';
if (ext === '.css') return 'tailwind.css';
return '[name]-[hash][extname]';
},
},
},
},
});