소스 검색

打包配置修改

zhaojijng 2 년 전
부모
커밋
e67cf5ed88
4개의 변경된 파일13개의 추가작업 그리고 9개의 파일을 삭제
  1. 1 0
      .gitignore
  2. 4 1
      config/config.ts
  3. 1 1
      config/proxy.ts
  4. 7 7
      config/routes.ts

+ 1 - 0
.gitignore

@@ -8,6 +8,7 @@ _roadhog-api-doc
 
 # production
 /dist
+/sgadmin
 
 # misc
 .DS_Store

+ 4 - 1
config/config.ts

@@ -49,9 +49,12 @@ export default defineConfig({
   esbuild: {},
   title: false,
   ignoreMomentLocale: true,
+  base: '/sgadmin/',
+  publicPath: '/sgadmin/',
+  outputPath: 'sgadmin',
   proxy: proxy[REACT_APP_ENV || 'dev'],
   manifest: {
-    basePath: '/',
+    basePath: '/sgadmin',
   },
   // Fast Refresh 热更新
   fastRefresh: {},

+ 1 - 1
config/proxy.ts

@@ -9,7 +9,7 @@
 export default {
   dev: {
     // localhost:8000/api/** -> https://preview.pro.ant.design/api/**
-    '/sgadmin/duoduo-service/': {
+    '/sgadmin/duoduo-service': {
       target: 'https://duoduoenv.sagacloud.cn/',
       // target: 'http://192.168.12.13:52011/',
       changeOrigin: true,

+ 7 - 7
config/routes.ts

@@ -19,30 +19,30 @@
     ],
   },
   {
-    path: '/sgadmin',
+    path: '/',
     component: '../layouts',
     routes: [
       {
-        path: '/sgadmin',
-        redirect: '/sgadmin/environment',
+        path: '/',
+        redirect: '/environment',
       },
       {
-        path: '/sgadmin/environment',
+        path: '/environment',
         name: 'environment',
         component: './Environment',
       },
       {
-        path: '/sgadmin/equipment',
+        path: '/equipment',
         name: 'equipment',
         component: './Equipment',
       },
       {
-        path: '/sgadmin/runtime',
+        path: '/runtime',
         name: 'runtime',
         component: './Runtime',
       },
       {
-        path: '/sgadmin/runtime/recordList',
+        path: '/runtime/recordList',
         name: 'recordList',
         component: './Runtime/RecordList',
       },