-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.ts
28 lines (27 loc) · 837 Bytes
/
vite.config.ts
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 { resolve } from 'path';
export default defineConfig({
base: '/public/', // Ensure base path is set correctly
build: {
manifest: true,
outDir: 'public',
rollupOptions: {
input: {
main: resolve(__dirname, 'views/scripts/index.ts'),
moduleLoader: resolve(__dirname, 'views/scripts/module-loader.ts'),
},
output: {
entryFileNames: (chunk) => {
// Name the module-loader file without a hash
if (chunk.name === 'moduleLoader') {
return 'assets/module-loader.js';
}
// Use hashes for other entry files
return 'assets/[name]-[hash].js';
},
chunkFileNames: 'assets/[name]-[hash].js',
assetFileNames: 'assets/[name]-[hash][extname]'
},
},
},
});