45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
import path from "node:path";
|
|
import { defineConfig } from "vite";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import { AntdvNextResolver } from "@antdv-next/auto-import-resolver";
|
|
import Components from "unplugin-vue-components/vite";
|
|
import { fileViewerRenderers } from "@file-viewer/vite-plugin";
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
server: {
|
|
host: "127.0.0.1",
|
|
port: 5180,
|
|
strictPort: true,
|
|
// 排除静态资源目录的监听:full 包复制出的 WASM/字体体积大,
|
|
// 在 Windows 下易被锁定导致 Vite 监听报 EBUSY 崩溃;public 下资源按需直接服务,无需监听
|
|
watch: {
|
|
ignored: [
|
|
"**/node_modules/**",
|
|
"**/.git/**",
|
|
"**/public/file-viewer/**",
|
|
],
|
|
},
|
|
proxy: {
|
|
"/api": {
|
|
target: "http://127.0.0.1:8088",
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
plugins: [
|
|
tailwindcss(),
|
|
vue(),
|
|
Components({
|
|
resolvers: [AntdvNextResolver()],
|
|
}),
|
|
fileViewerRenderers({ copyAssets: true }),
|
|
],
|
|
});
|