-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathvite.config.ts
More file actions
53 lines (51 loc) · 1.15 KB
/
vite.config.ts
File metadata and controls
53 lines (51 loc) · 1.15 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import legacy from '@vitejs/plugin-legacy';
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
import process from 'node:process';
import unocss from 'unocss/vite';
import data from 'unplugin-data/vite';
import { defineConfig, type ESBuildOptions } from 'vite';
import { _404Page, mirror, svgMinify, unAutoImport } from './plugins';
// support top-level-await
const chromeVersion = 89;
const host = '127.0.0.1';
const port = 8444;
export default defineConfig(() => {
return {
plugins: [
svgMinify(),
vue(),
vueJsx(),
unocss({ inspector: false }),
unAutoImport(),
data(),
legacy({
renderLegacyChunks: false,
modernPolyfills: true,
modernTargets: `chrome>=${chromeVersion}`,
}),
mirror(),
_404Page(),
],
resolve: {
alias: {
'@': process.cwd() + '/src',
},
},
server: {
host,
port,
},
preview: {
host,
port,
},
build: {
sourcemap: true,
chunkSizeWarningLimit: Number.MAX_SAFE_INTEGER,
},
esbuild: {
legalComments: 'none',
} as ESBuildOptions,
};
});