-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathvite.config.js
38 lines (36 loc) · 1.06 KB
/
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
35
36
37
38
import {defineConfig} from 'vite'
import {svelte} from '@sveltejs/vite-plugin-svelte'
export default defineConfig(({mode}) => {
const output = {};
if (mode === 'development') {
output.assetFileNames = 'assets/[name].development[extname]';
output.chunkFileNames = 'assets/[name].development[extname]';
output.entryFileNames = 'assets/[name].development.js';
}
else {
output.assetFileNames = 'assets/[name].[hash][extname]';
output.chunkFileNames = 'assets/[name].[hash][extname]';
output.entryFileNames = 'assets/[name].[hash].js';
}
return {
build: {
assetsInlineLimit: 0,
cssCodeSplit: false,
emptyOutDir: false,
outDir: 'public',
minify: mode === 'development' ? false : 'esbuild',
rollupOptions: {input: './assets/convos.js', output},
},
plugins: [svelte()],
publicDir: 'does/not/matter',
resolve: {
alias: {
'../font/fa-5.15.4': './public/font/fa-5.15.4',
'../font/google': './public/font/google',
},
},
test: {
environment: 'jsdom',
},
};
})