-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
62 lines (60 loc) · 1.58 KB
/
vite.config.ts
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
54
55
56
57
58
59
60
61
62
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import VueI18nPlugin from "@intlify/unplugin-vue-i18n/vite";
import Components from "unplugin-vue-components/vite";
import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";
import { viteCommonjs } from "@originjs/vite-plugin-commonjs";
import path, { dirname, resolve } from "path";
const pathSrc = resolve(__dirname, "src");
const backend = {
target: "http://localhost:8081/",
changeOrigin: false,
ws: true,
};
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
"@/": `${pathSrc}/`,
vue: "vue/dist/vue.esm-bundler.js",
},
},
server: {
proxy: {
"/api": backend,
"/oauth2": backend,
"/provider": backend,
"/proxies": backend,
},
},
build: {
target: ["edge90", "chrome90", "firefox90", "safari15"],
},
plugins: [
vue(),
VueI18nPlugin({
/* options */
// locale messages resource pre-compile option
include: path.resolve(__dirname, "./src/locales/**"),
}),
viteCommonjs(),
Components({
dts: "src/components.d.ts",
types: [
{
from: "vue-router",
names: ["RouterLink", "RouterView"],
},
],
// allow auto load markdown components under `./src/components/`
extensions: ["vue", "md"],
// allow auto import and register components used in markdown
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
resolvers: [
AntDesignVueResolver({
resolveIcons: true,
}),
],
}),
],
});