소스 검색

fix: process is not defined in path

xiaoxian521 2 년 전
부모
커밋
1ed598c5f2
2개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 0 3
      index.html
  2. 2 0
      vite.config.ts

+ 0 - 3
index.html

@@ -10,9 +10,6 @@
     />
     <title>vue-pure-admin</title>
     <link rel="icon" href="/favicon.ico" />
-    <script>
-      window.process = {};
-    </script>
   </head>
 
   <body>

+ 2 - 0
vite.config.ts

@@ -70,6 +70,8 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
       chunkSizeWarningLimit: 4000
     },
     define: {
+      "process.platform": null,
+      "process.version": null,
       __INTLIFY_PROD_DEVTOOLS__: false,
       __APP_INFO__: JSON.stringify(__APP_INFO__)
     }