-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
28 lines (25 loc) · 1 KB
/
vite.config.js
File metadata and controls
28 lines (25 loc) · 1 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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import svgr from 'vite-plugin-svgr';
export default defineConfig({
plugins: [react(), svgr()],
build: {
rollupOptions: {
output: {
entryFileNames: 'assets/js/[name]-[hash].js',
chunkFileNames: 'assets/js/[name]-[hash].js',
assetFileNames: (assetInfo) => {
// Check if the asset name matches common font extensions
if (/\.(woff2?|ttf|eot|svg)$/.test(assetInfo.name ?? '')) {
return 'assets/fonts/[name][extname]'; // Custom path for fonts
}
// Default behavior for other assets like CSS or images
if (/\.css$/.test(assetInfo.name ?? '')) {
return 'assets/css/[name]-[hash][extname]';
}
return 'assets/[name]-[hash][extname]';
},
},
},
},
});