-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
43 lines (42 loc) · 1005 Bytes
/
vite.config.js
File metadata and controls
43 lines (42 loc) · 1005 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { sveltekit } from '@sveltejs/kit/vite'
import { defineConfig } from 'vite'
import { resolve } from 'path'
import viteCompression from 'vite-plugin-compression'
export default defineConfig(({ mode }) => ({
plugins: [
sveltekit(),
...(mode === 'production'
? [
viteCompression({
algorithm: 'gzip',
ext: '.gz',
threshold: 1024,
deleteOriginFile: false,
}),
viteCompression({
algorithm: 'brotliCompress',
ext: '.br',
threshold: 1024,
deleteOriginFile: false,
}),
]
: []),
],
build: {
minify: mode === 'production' ? 'esbuild' : false,
cssMinify: mode === 'production',
rollupOptions: {
output: {
...(mode === 'development' && {
format: 'es',
compact: false,
}),
},
},
},
resolve: {
alias: {
'@assets': resolve(__dirname, 'src/assets'),
},
},
}))