123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- import { defineConfig } from "vite";
- import vue from "@vitejs/plugin-vue";
- import { resolve } from "path";
- import ElementPlus from "unplugin-element-plus/vite";
- let app = "criminal";
- if (process.argv.length > 3) {
- app = process.argv[process.argv.length - 1].trim();
- }
- const dev = true;
- export default defineConfig({
- define: {
- VITE_APP_APP: JSON.stringify(app),
- },
- base: "./",
- build: {
- outDir: `dist/${app}`,
- },
- resolve: {
- alias: [
- {
- find: "@",
- replacement: resolve(__dirname, "./src"),
- },
- ],
- },
- css: {
- preprocessorOptions: {
- scss: {
- additionalData: `@use "@/app/${app}/useStyle.scss" as *;`,
- },
- },
- },
- plugins: [
- vue(),
- ElementPlus({
- useSource: true,
- }),
- ],
- server: {
- port: 5173,
- proxy: {
- "/api": {
- target: dev ? "http://test-mix3d.4dkankan.com" : "mix3d.4dkankan.com",
- changeOrigin: true,
- rewrite: (path) => path.replace(new RegExp(`^/api`), ""),
- },
- "/fusion": {
- target: dev ? "https://test-mix3d.4dkankan.com" : "mix3d.4dkankan.com",
- changeOrigin: true,
- rewrite: (path) => path.replace(new RegExp(`^/api`), "/fusion"),
- },
- "/dev-code": {
- // target: "https://localhost:7173/",
- target: dev
- ? "https://test-mix3d.4dkankan.com/code"
- : "https://mix3d.4dkankan.com/code",
- changeOrigin: true,
- secure: false,
- rewrite: (path) => path.replace(new RegExp(`^/dev-code`), ""),
- },
- "/swkk": {
- target: dev ? "https://test.4dkankan.com" : "https://www.4dkankan.com",
- changeOrigin: true,
- rewrite: (path) => path.replace(new RegExp(`^/swkk`), ""),
- },
- "/service": {
- target: dev ? "https://test.4dkankan.com" : "https://www.4dkankan.com",
- changeOrigin: true,
- },
- "/swss": {
- target: dev
- ? "https://uat-laser.4dkankan.com/uat"
- : "https://laser.4dkankan.com",
- changeOrigin: true,
- rewrite: (path) => path.replace(new RegExp(`^/swss`), ""),
- },
- "/laser": {
- target: dev
- ? "https://uat-laser.4dkankan.com"
- : "https://laser.4dkankan.com",
- changeOrigin: true,
- rewrite: (path) => path.replace(new RegExp(`^/laser`), "/laser"),
- },
- "/fdkk": {
- target: dev
- ? "https://uat-laser.4dkankan.com/uat"
- : "https://laser.4dkankan.com",
- changeOrigin: true,
- rewrite: (path) => path.replace(new RegExp(`^/swss`), ""),
- },
- },
- },
- });
|