Browse Source

fix: pnpm打包报错处理

赖奇 1 year ago
parent
commit
914312b07e
2 changed files with 5 additions and 4 deletions
  1. 1 0
      apps/web-ele/components.d.ts
  2. 4 4
      apps/web-ele/vite.config.mts

+ 1 - 0
apps/web-ele/components.d.ts

@@ -7,6 +7,7 @@ export {};
 /* prettier-ignore */
 declare module 'vue' {
   export interface GlobalComponents {
+    ElButton: typeof import('element-plus/es')['ElButton']
     RouterLink: typeof import('vue-router')['RouterLink']
     RouterView: typeof import('vue-router')['RouterView']
   }

+ 4 - 4
apps/web-ele/vite.config.mts

@@ -28,15 +28,15 @@ export default defineConfig(async () => {
         alias: {
           '@': path.resolve('./src'),
         },
-        extensions: ['.js', '.ts', '.jsx', '.tsx', '.json', 'vue'],
+        extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
       },
       server: {
         proxy: {
-          '/dev-api': {
+          '/api': {
             changeOrigin: true,
-            rewrite: (path) => path.replace(/^\/dev-api/, ''),
+            rewrite: (path) => path.replace(/^\/api/, ''),
             // mock代理目标地址
-            target: 'http://211.149.199.65:5012/',
+            target: 'http://211.149.199.65:5010/',
             ws: true,
           },
         },