Browse Source

refactor: 配置修改

master
niushuai233 2 years ago
parent
commit
1e7216feef
  1. 2
      .env
  2. 6
      .env.development
  3. 6
      .env.production
  4. 8
      .env.test
  5. 2
      package.json
  6. 32
      vue.config.js

2
.env

@ -1,5 +1,5 @@
NODE_ENV=development NODE_ENV=development
VUE_APP_PLATFORM_NAME=JeecgBoot 企业级低代码平台 VUE_APP_PLATFORM_NAME=DB Bastion Server
# 开启单点登录 # 开启单点登录
VUE_APP_SSO=false VUE_APP_SSO=false
# 开启微应用模式 # 开启微应用模式

6
.env.development

@ -1,7 +1,7 @@
NODE_ENV=development NODE_ENV=development
VUE_APP_API_BASE_URL=http://localhost:8080/ VUE_APP_API_BASE_URL=http://localhost:8080/devApi
VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas VUE_APP_CAS_BASE_URL=http:///cas
VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview VUE_APP_ONLINE_BASE_URL=http:///onlinePreview
# 微应用列表必须VUE_APP_SUB_开头,jeecg-app-1为子应用的项目名称,也是子应用的路由父路径 # 微应用列表必须VUE_APP_SUB_开头,jeecg-app-1为子应用的项目名称,也是子应用的路由父路径
VUE_APP_SUB_jeecg-app-1 = '//localhost:8092' VUE_APP_SUB_jeecg-app-1 = '//localhost:8092'

6
.env.production

@ -1,4 +1,4 @@
NODE_ENV=production NODE_ENV=production
VUE_APP_API_BASE_URL=http://localhost:8080/jeecg-boot VUE_APP_API_BASE_URL=http://localhost:8080/prodApi
VUE_APP_CAS_BASE_URL=http://localhost:8888/cas VUE_APP_CAS_BASE_URL=http:///cas
VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview VUE_APP_ONLINE_BASE_URL=http:///onlinePreview

8
.env.test

@ -1,4 +1,4 @@
NODE_ENV=production NODE_ENV=test
VUE_APP_API_BASE_URL=http://boot.jeecg.com:8080/jeecg-boot VUE_APP_API_BASE_URL=http://localhost:8080/testApi
VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas VUE_APP_CAS_BASE_URL=http:///cas
VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview VUE_APP_ONLINE_BASE_URL=http:///onlinePreview

2
package.json

@ -1,5 +1,5 @@
{ {
"name": "vue-antd-jeecg", "name": "db-bastion-vue-antd",
"version": "3.4.3", "version": "3.4.3",
"private": true, "private": true,
"scripts": { "scripts": {

32
vue.config.js

@ -1,5 +1,5 @@
const path = require('path') const path = require('path')
const CompressionPlugin = require("compression-webpack-plugin") const CompressionPlugin = require('compression-webpack-plugin')
function resolve(dir) { function resolve(dir) {
return path.join(__dirname, dir) return path.join(__dirname, dir)
@ -14,8 +14,8 @@ module.exports = {
*/ */
// 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。 // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
productionSourceMap: false, productionSourceMap: false,
//qiankuan打包时放开 // qiankuan打包时放开
//outputDir: "../dist/main", // outputDir: "../dist/main",
// 多入口配置 // 多入口配置
// pages: { // pages: {
// index: { // index: {
@ -24,10 +24,10 @@ module.exports = {
// filename: 'index.html', // filename: 'index.html',
// } // }
// }, // },
//打包app时放开该配置 // 打包app时放开该配置
//publicPath:'/', // publicPath:'/',
configureWebpack: config => { configureWebpack: config => {
//生产环境取消 console.log // 生产环境取消 console.log
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
} }
@ -40,7 +40,7 @@ module.exports = {
.set('@comp', resolve('src/components')) .set('@comp', resolve('src/components'))
.set('@views', resolve('src/views')) .set('@views', resolve('src/views'))
//生产环境,开启js\css压缩 // 生产环境,开启js\css压缩
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
config.plugin('compressionPlugin').use(new CompressionPlugin({ config.plugin('compressionPlugin').use(new CompressionPlugin({
test: /\.(js|css|less)$/, // 匹配文件名 test: /\.(js|css|less)$/, // 匹配文件名
@ -68,9 +68,7 @@ module.exports = {
.use() .use()
.loader('babel-loader') .loader('babel-loader')
.end() .end()
}, },
css: { css: {
loaderOptions: { loaderOptions: {
less: { less: {
@ -78,9 +76,9 @@ module.exports = {
/* less 变量覆盖,用于自定义 ant design 主题 */ /* less 变量覆盖,用于自定义 ant design 主题 */
'primary-color': '#1890FF', 'primary-color': '#1890FF',
'link-color': '#1890FF', 'link-color': '#1890FF',
'border-radius-base': '4px', 'border-radius-base': '4px'
}, },
javascriptEnabled: true, javascriptEnabled: true
} }
} }
}, },
@ -102,16 +100,16 @@ module.exports = {
ws: false, ws: false,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
'/jeecg-boot': '' //默认所有请求都加了jeecg-boot前缀,需要去掉 '/xxx': '' //默认所有请求都加了xxx前缀,需要去掉
} }
},*/ }, */
/* jeecgboot.env /* xxx.env
issues/3462 很多人此处做了配置导致刷新前端404问题请一定注意*/ issues/3462 很多人此处做了配置导致刷新前端404问题请一定注意 */
'/jeecg-boot': { '/xxx': {
target: 'http://localhost:8080', target: 'http://localhost:8080',
ws: false, ws: false,
changeOrigin: true changeOrigin: true
}, }
} }
}, },

Loading…
Cancel
Save