-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvite.config.ts
37 lines (36 loc) · 998 Bytes
/
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
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import AutoImport from "unplugin-auto-import/vite";
import { resolve } from "path";
import { createHtmlPlugin } from "vite-plugin-html";
import Inspector from "unplugin-vue-inspector/vite";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
// vueDevTools(),
vue(),
AutoImport({
imports: ["vue", "vue-router"], //自动引入vue的ref、toRefs、onmounted等,无需在页面中再次引入
dts: "src/auto-import.d.ts", // 生成在src路径下名为auto-import.d.ts的声明文件
}),
Inspector(),
createHtmlPlugin(),
],
resolve: {
alias: [
{
find: "@",
replacement: resolve(__dirname, "src"),
},
],
},
base: "./", // 打包路径
server: {
host: "localhost",
headers: {
"Cross-Origin-Opener-Policy": "same-origin",
"Cross-Origin-Embedder-Policy": "require-corp",
},
port: 8085,
},
});