-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.js
34 lines (33 loc) · 1021 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
import { reactRouter } from '@react-router/dev/vite';
import { defineConfig } from 'vite';
import { comlink } from 'vite-plugin-comlink';
import tsconfigPaths from 'vite-tsconfig-paths';
export default defineConfig({
base: process.env.PUBLIC_BASE_PATH ?? '/',
build: {
cssMinify: true,
rollupOptions: {
output: {
assetFileNames: 'assets/asset-[hash][extname]',
chunkFileNames: 'assets/chunk-[hash].js',
entryFileNames: 'assets/entry-[hash].js',
hashCharacters: 'base36',
},
},
},
plugins: [comlink(), process.env.VITEST === 'true' ? null : reactRouter(), tsconfigPaths()],
test: {
setupFiles: ['./test/setup'],
},
worker: {
plugins: () => [comlink(), tsconfigPaths()],
rollupOptions: {
output: {
assetFileNames: 'assets/worker-asset-[hash][extname]',
chunkFileNames: 'assets/worker-chunk-[hash].js',
entryFileNames: 'assets/worker-entry-[hash].js',
hashCharacters: 'base36',
},
},
},
});