Browse Source

fix:submit config file

jimmyyem 7 months ago
parent
commit
d2381fdf66
4 changed files with 94 additions and 1 deletions
  1. 23 0
      .env.yanhuaguo
  2. 13 0
      internal/vite-config/dist/index.mjs.yanhuaguo
  3. 1 1
      package.json
  4. 57 0
      vite.config.ts.yanhuaguo

+ 23 - 0
.env.yanhuaguo

@@ -0,0 +1,23 @@
+# Whether to open mock
+VITE_USE_MOCK = false
+
+# public path
+VITE_PUBLIC_PATH = /
+
+VITE_BUILD_COMPRESS = 'none'
+
+# Delete console
+VITE_DROP_CONSOLE = false
+
+# vite 本地跨域代理
+# VITE_PROXY=[["/fms-api","https://wxadminapi.gkscrm.com"]]
+# Basic interface address SPA
+VITE_GLOB_API_URL=
+# File upload address, optional
+VITE_GLOB_UPLOAD_URL=https://wxadminapi.gkscrm.com
+# VITE_GLOB_API_URL=
+# VITE_GLOB_API_URL=/sys-api
+
+# Interface prefix
+VITE_GLOB_API_URL_PREFIX=
+VITE_GLOB_APP_TITLE=

+ 13 - 0
internal/vite-config/dist/index.mjs.yanhuaguo

@@ -0,0 +1,13 @@
+import jiti from "file:///Users/yanhuaguo/work/golang/src/ascrm/wechat-ui/node_modules/.pnpm/jiti@1.21.6/node_modules/jiti/lib/index.js";
+
+/** @type {import("/Users/yanhuaguo/work/golang/src/ascrm/wechat-ui/internal/vite-config/src/index")} */
+const _module = jiti(null, {
+  "esmResolve": true,
+  "interopDefault": true,
+  "alias": {
+    "@vben/vite-config": "/Users/yanhuaguo/work/golang/src/ascrm/wechat-ui/internal/vite-config"
+  }
+})("/Users/yanhuaguo/work/golang/src/ascrm/wechat-ui/internal/vite-config/src/index.ts");
+
+export const defineApplicationConfig = _module.defineApplicationConfig;
+export const definePackageConfig = _module.definePackageConfig;

+ 1 - 1
package.json

@@ -24,7 +24,7 @@
     "build:no-cache": "pnpm store prune && npm run build",
     "build:test": "cross-env NODE_OPTIONS=--max-old-space-size=8192 pnpm vite build --mode test",
     "commit": "czg",
-    "dev": "pnpm vite",
+    "dev": "NODE_ENV=dev pnpm vite",
     "preinstall": "npx only-allow pnpm",
     "postinstall": "turbo run stub",
     "lint": "turbo run lint",

+ 57 - 0
vite.config.ts.yanhuaguo

@@ -0,0 +1,57 @@
+// vite.config.ts
+import { defineApplicationConfig } from "file:///Users/yanhuaguo/work/golang/src/ascrm/wechat-ui/internal/vite-config/dist/index.mjs";
+
+export default defineApplicationConfig({
+  overrides: {
+    optimizeDeps: {
+      include: [
+        'echarts/core',
+        'echarts/charts',
+        'echarts/components',
+        'echarts/renderers',
+        '@iconify/iconify',
+        'ant-design-vue/es/locale/zh_CN',
+        'ant-design-vue/es/locale/en_US',
+      ],
+    },
+    server: {
+      proxy: {
+        "/api":{
+          target: 'http://localhost:19101',
+          changeOrigin: true,
+          ws: true,
+          rewrite: (path) => path.replace(new RegExp(`^/api`), ''),
+        },
+        '/sys-api': {
+          target: 'http://localhost:9100',
+          changeOrigin: true,
+          ws: true,
+          rewrite: (path) => path.replace(new RegExp(`^/sys-api`), ''),
+          // only https
+          // secure: false
+        },
+        '/fms-api': {
+          target: 'http://localhost:9102',
+          changeOrigin: true,
+          ws: true,
+          rewrite: (path) => path.replace(new RegExp(`^/fms-api`), ''),
+        },
+        '/mms-api': {
+          target: 'http://localhost:9104',
+          changeOrigin: true,
+          ws: true,
+          rewrite: (path) => path.replace(new RegExp(`^/mms-api`), ''),
+        },
+        '/wechat-api': {
+          target: 'http://localhost:19101',
+          changeOrigin: true,
+          ws: true,
+          rewrite: (path) => path.replace(new RegExp(`^/wechat-api`), ''),
+        },
+      },
+      warmup: {
+        clientFiles: ['./index.html', './src/{views,components}/*'],
+      },
+    },
+  },
+});