-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
30 lines (29 loc) · 807 Bytes
/
vite.config.ts
File metadata and controls
30 lines (29 loc) · 807 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
import { ConfigEnv, UserConfigExport, loadEnv } from 'vite';
import vue from '@vitejs/plugin-vue';
import { resolve } from 'path';
import svgLoader from 'vite-svg-loader';
import vueJsx from '@vitejs/plugin-vue-jsx';
import yamlLoader from '@rollup/plugin-yaml';
import UnoCSS from 'unocss/vite';
// https://vitejs.dev/config/
export default ({ mode }: ConfigEnv): UserConfigExport => {
const env = loadEnv(mode, __dirname, '');
return {
base: './',
plugins: [vue(), vueJsx(), svgLoader(), yamlLoader(), UnoCSS()],
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
'@root': __dirname,
},
},
envPrefix: 'APP_',
server: {
port: Number(env.APP_PORT),
},
build: {
target: 'ESNext',
chunkSizeWarningLimit: 2000,
},
};
};