增加轻量启动模式,只加载相关项目的代码,来减少构建,启动,刷新,调试所需要的时间

This commit is contained in:
aixianling
2023-10-10 16:46:43 +08:00
parent 5b09630e62
commit de994686f7
4 changed files with 40 additions and 83 deletions

View File

@@ -1,4 +1,8 @@
const path = require('path');
const proxy = {
dv: "https://pingchangdjweb.icunwei.com/",
fengdu: "https://web.fdfengshou.cn/"
}[process.env.VUE_APP_SCOPE] || "http://192.168.1.87:9000"
module.exports = {
lintOnSave: false,
productionSourceMap: false,
@@ -17,90 +21,33 @@ module.exports = {
filename: 'index.html'
}
},
transpileDependencies: [/dui[\\\/]lib[\\\/]js/],
transpileDependencies: [/dui[\\\/]lib[\\\/]js/, /manifest.js/],
chainWebpack: (config) => {
config.module
.rule('js')
.include
.add(path.resolve(__dirname, 'packages'))
.add(path.resolve(__dirname, 'components'))
.add(path.resolve(__dirname, 'project'))
.add(path.resolve(__dirname, 'examples'))
.add(path.resolve(__dirname, 'ui'))
.end().use('babel').loader('babel-loader').tap(options => options);
.rule('js')
.include
.add(path.resolve(__dirname, 'packages'))
.add(path.resolve(__dirname, 'components'))
.add(path.resolve(__dirname, 'project'))
.add(path.resolve(__dirname, 'examples'))
.add(path.resolve(__dirname, 'ui'))
.end().use('babel').loader('babel-loader').tap(options => options);
config.plugin("limit").use(require("webpack/lib/optimize/LimitChunkCountPlugin"), [{maxChunks: 10}]).tap(options => options)
},
devServer: {
host: '0.0.0.0', //主机地址
port: 80, //端口号
open: true,
// devtool: 'cheap-module-eval-source-map',
proxy: {
//设置代理,可解决跨5
//设置代理,可解决跨
'/lan': {
target: 'http://192.168.1.87:9000',
target: proxy,
changeOrigin: true,
pathRewrite: {
//地址重写
'^/lan': '/'
}
},
'/analysis': {
target: 'http://192.168.1.87:22001',
changeOrigin: true,
pathRewrite: {
//地址重写
'^/analysis': '/'
}
},
'/saas': {
target: 'http://192.168.1.34:19898',
changeOrigin: true,
pathRewrite: {
//地址重写
'^/saas': '/'
}
},
'/omsapi': {
target: 'http://192.168.1.87:19897',
changeOrigin: true,
pathRewrite: {
//地址重写
'^/omsapi': '/'
}
},
'/ns': {
target: 'http://192.168.1.87:12525',
changeOrigin: true,
pathRewrite: {
//地址重写
'^/ns': '/'
}
},
'/lns': {
target: 'http://localhost:12525',
changeOrigin: true,
pathRewrite: {
//地址重写
'^/lns': '/'
}
},
'/tfx': {
target: 'http://192.168.1.87:59998',
changeOrigin: true,
pathRewrite: {
//地址重写
'^/tfx': '/'
}
},
'/map': {
target: 'https://geo.datav.aliyun.com',
changeOrigin: true,
pathRewrite: {
//地址重写
'^/map': '/'
}
}
},
disableHostCheck: true,
}