-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
40 lines (38 loc) · 1.07 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
39
40
import { defineConfig, loadEnv } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import UnoCSS from 'unocss/vite'
import { resolve } from 'path';
import TransformPages from './transform-pages.js'
export default defineConfig(({ mode, command }) => {
const env = loadEnv(mode, process.cwd());
return {
plugins: [
uni(),
UnoCSS()
],
define: {
ROUTES: new TransformPages().routes
},
css: {
preprocessorOptions: {
scss: {
silenceDeprecations: ["legacy-js-api"]
},
},
},
resolve: {
alias: {
'@': resolve(__dirname, './src'),
},
},
server: {
proxy: {
[env.VITE_COMMON_API_PREFIX]: {
target: env.VITE_COMMON_API_URL,
changeOrigin: true,
rewrite: (path) => path.replace(new RegExp('^' + env.VITE_COMMON_API_PREFIX), '')
}
}
}
}
});