// Plugins import vue from "@vitejs/plugin-vue"; import vuetify, { transformAssetUrls } from "vite-plugin-vuetify"; // Utilities import { defineConfig } from "vite"; import { fileURLToPath, URL } from "node:url"; import AutoImport from "unplugin-auto-import/vite"; import Components from "unplugin-vue-components/vite"; import { ElementPlusResolver } from "unplugin-vue-components/resolvers"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [ vue({ template: { transformAssetUrls }, }), // https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin vuetify({ autoImport: true, }), AutoImport({ resolvers: [ElementPlusResolver()], }), Components({ resolvers: [ElementPlusResolver()], }), ], define: { "process.env": {} }, resolve: { alias: { "@": fileURLToPath(new URL("./src", import.meta.url)), }, extensions: [".js", ".json", ".jsx", ".mjs", ".ts", ".tsx", ".vue"], }, server: { port: 3000, proxy: { "/v1": { // target: "http://s3.s100.vip:26381/v1", target: "http://192.168.1.141:8086/v1", // target: "http://127.0.0.1:3000/v1", changeOrigin: true, rewrite: (path) => path.replace(/^\/v1/, ""), }, "/udp": { // target: "http://s3.s100.vip:26381/v1", // target: "http://192.168.1.55:8001/", target: "http://127.0.0.1:9010/udp", // target: "http://192.168.8.109:9010/udp", changeOrigin: true, rewrite: (path) => path.replace(/^\/udp/, ""), }, // "/vedio": { // target: "http://192.168.1.64/vedio", // // target: "http://192.168.1.141:8086/v1", // changeOrigin: true, // rewrite: (path) => path.replace(/^\/vedio/, ""), // }, }, }, build: { sourcemap: true, }, });