forked from openimsdk/openim-h5-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
59 lines (58 loc) · 1.67 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
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { resolve } from "path";
import Components from "unplugin-vue-components/vite";
import { VantResolver } from "unplugin-vue-components/resolvers";
import AutoImport from "unplugin-auto-import/vite";
import VueSetupExtend from "vite-plugin-vue-setup-extend";
import vueJsx from "@vitejs/plugin-vue-jsx";
import { VueAmapResolver } from "@vuemap/unplugin-resolver";
import userConfig from "./config";
// https://vitejs.dev/config/
export default defineConfig({
server: {
port: 3003,
host: "0.0.0.0",
hmr: true,
},
define: {
"process.env":
process.env.NODE_ENV === "production"
? userConfig.buildEnv
: userConfig.devEnv,
},
css: {
// preprocessorOptions: {
// scss: {
// additionalData: `@import "@/styles/variable.scss";`,
// },
// },
},
plugins: [
vue(),
vueJsx(),
VueSetupExtend(),
Components({
resolvers: [VantResolver(), VueAmapResolver()],
}),
AutoImport({
imports: ["vue", "vue-router", "vue-i18n"],
dts: "src/auto-import.d.ts",
resolvers: [VueAmapResolver()],
}),
],
resolve: {
alias: {
"@": resolve(__dirname, "src"),
"@pages": resolve(__dirname, "src/pages"),
"@components": resolve(__dirname, "src/components"),
"@layout": resolve(__dirname, "src/layout"),
"@api": resolve(__dirname, "src/api"),
"@utils": resolve(__dirname, "src/utils"),
"@store": resolve(__dirname, "src/store"),
"@assets": resolve(__dirname, "src/assets"),
"@i18n": resolve(__dirname, "src/i18n"),
"@type": resolve(__dirname, "src/type"),
},
},
});