瀏覽代碼

+ 管理端前端打包配置

chen.cheng 11 月之前
父節點
當前提交
01c512550b
共有 4 個文件被更改,包括 19 次插入4 次删除
  1. 2 0
      ruoyi-ui/.env.production
  2. 3 1
      ruoyi-ui/.env.test
  3. 13 1
      ruoyi-ui/babel.config.js
  4. 1 2
      ruoyi-ui/vue.config.js

+ 2 - 0
ruoyi-ui/.env.production

@@ -4,6 +4,8 @@ VUE_APP_TITLE = 交通强国工作台
 # 生产环境配置
 ENV = 'production'
 
+BABEL_ENV = production
+
 # 若依管理系统/生产环境
 VUE_APP_BASE_API = '/prod-api'
 

+ 3 - 1
ruoyi-ui/.env.test

@@ -4,7 +4,9 @@ VUE_APP_TITLE = 交通强国工作台
 # 生产环境配置
 ENV = 'production'
 
+BABEL_ENV = production
+
 # 若依管理系统/生产环境
 VUE_APP_BASE_API = '/prod-api'
 
-VUE_APP_BASE_URL = 'http://172.192.13.80:8080'
+VUE_APP_BASE_URL = 'http://172.192.13.80:8080/tfc'

+ 13 - 1
ruoyi-ui/babel.config.js

@@ -8,6 +8,18 @@ module.exports = {
       // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().
       // This plugin can significantly increase the speed of hot updates, when you have a large number of pages.
       'plugins': ['dynamic-import-node']
+    },
+    // ²âÊÔ»·¾³
+    'staging': {
+      'plugins': ['@babel/plugin-syntax-dynamic-import']
+    },
+    // Éú²ú»·¾³
+    'production': {
+      'plugins': ['@babel/plugin-syntax-dynamic-import']
+    },
+    // test
+    'test': {
+      'plugins': ['@babel/plugin-syntax-dynamic-import']
     }
   }
-}
+}

+ 1 - 2
ruoyi-ui/vue.config.js

@@ -10,7 +10,6 @@ const CompressionPlugin = require('compression-webpack-plugin')
 const name = process.env.VUE_APP_TITLE || '若依管理系统' // 网页标题
 
 const port = process.env.port || process.env.npm_config_port || 80 // 端口
-
 // vue.config.js 配置说明
 //官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
 // 这里只列一部分,具体配置参考文档
@@ -38,7 +37,7 @@ module.exports = {
         target: process.env.VUE_APP_BASE_URL,
         changeOrigin: true,
         pathRewrite: {
-          ['^' + process.env.VUE_APP_BASE_API]: '/tfc'
+          ['^' + process.env.VUE_APP_BASE_API]: ''
         }
       }
     },