| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- import { defineConfig } from "vite";
- import path from "path";
- import uni from "@dcloudio/vite-plugin-uni";
- export default defineConfig(({ mode, command }) => {
- return {
- base: "./", // 打包路径
- server: {
- hmr: true, //热更新
- host: true, //指定服务器
- open: true, //自动打开浏览器
- port: 81, //启动端口
- proxy: {
- "/dev-api": {
- target: "http://192.168.123.10:13200",
- ws: true,
- changeOrigin: true,
- //rewrite: (p) => p.replace(/^\/dev-api/, '')
- },
- "/prod-api": {
- target: "https://gateway.usky.cn",
- ws: true,
- changeOrigin: true,
- //rewrite: (p) => p.replace(/^\/dev-api/, '')
- },
- },
- },
- plugins: [
- uni({
- vueOptions: {
- template: {
- compilerOptions: {
- // 原生插件组件,勿当 Vue 组件解析(消除 Failed to resolve component 警告)
- isCustomElement: (tag) => tag === "door-camera-x" || tag === "my-face-camera",
- },
- },
- },
- }),
- ],
- resolve: {
- alias: {
- "@/": path.resolve(__dirname, "src"),
- "@/static": path.resolve(__dirname, "src/static"),
- "@/utils": path.resolve(__dirname, "src/utils"),
- },
- },
- };
- });
|