jhbigscreen/vue.config.js

128 lines
3.5 KiB
JavaScript
Raw Normal View History

2023-08-10 01:16:23 +08:00
const { defineConfig } = require('@vue/cli-service')
2024-08-11 23:01:48 +08:00
const WebpackObfuscator = require('webpack-obfuscator')
2023-08-10 01:16:23 +08:00
module.exports = defineConfig({
transpileDependencies: true,
2023-10-09 22:51:01 +08:00
publicPath :'/jhbs' ,
2023-08-10 01:16:23 +08:00
productionSourceMap:false,
devServer: {
host: '0.0.0.0',
port: 3000,
open: true,
2023-08-26 23:35:33 +08:00
proxy: {
2024-03-24 01:36:02 +08:00
// '/jhapi/profile':{
// target: `http://62.234.3.186/jhapi/profile/`,
// changeOrigin: true,
// pathRewrite: {
// '^/jhapi/profile':'/'
// }
// },
2023-10-09 22:51:01 +08:00
'/jhapp':{
target: `http://62.234.3.186/`,
changeOrigin: true,
pathRewrite: {
'^/jhapp':'/'
}
},
2023-08-31 01:00:20 +08:00
'/cesium':{
target: `http://62.234.3.186/cesium/`,
changeOrigin: true,
pathRewrite: {
'^/cesium':'/'
}
2023-12-23 23:34:48 +08:00
},
'/cdn':{
target: `http://62.234.3.186/cdn/`,
changeOrigin: true,
pathRewrite: {
'^/cdn':'/'
}
2023-08-31 01:00:20 +08:00
},
2023-08-26 14:50:34 +08:00
'/jhapi':{
//target: `http://62.234.3.186/jhapi/`,
target: `http://127.0.0.1:8090/jhapi/`,
2024-04-08 01:54:38 +08:00
//target: `http://szgc.jhncidg.com/jhapi/`,
2023-08-15 23:08:27 +08:00
changeOrigin: true,
pathRewrite: {
2023-08-26 14:50:34 +08:00
'^/jhapi':'/'
2023-08-15 23:08:27 +08:00
}
2023-08-26 22:19:33 +08:00
},
'/profile':{
2024-04-29 23:00:47 +08:00
//target: `http://szgc.jhncidg.com/jhapi/profile`,
target: `http://62.234.3.186/profile/`,
2023-08-26 22:19:33 +08:00
changeOrigin: true,
pathRewrite: {
'^/profile':'/'
}
}
2023-08-10 01:16:23 +08:00
}
2023-08-28 00:01:48 +08:00
},
2023-10-03 21:31:40 +08:00
/* pages:{
2023-08-10 01:16:23 +08:00
index:{
entry:'src/pages/index.js',
template:'public/index.html',
title:'项目概况',
filename:'index.html'
},
projectDetail:{
entry:'src/pages/projectDetail.js',
2023-09-14 00:59:01 +08:00
template:'public/detail.html',
2023-08-10 01:16:23 +08:00
title:'项目详情',
filename:'projectDetail.html'
},
projectSafety:{
entry:'src/pages/projectSafety.js',
template:'public/index.html',
title:'安全管理',
filename:'projectSafety.html'
},
projectQuality:{
entry:'src/pages/projectQuality.js',
template:'public/index.html',
title:'质量管理',
filename:'projectQuality.html'
},
projectProgress:{
entry:'src/pages/projectProgress.js',
template:'public/index.html',
title:'进度管理',
filename:'projectProgress.html'
},
projectVideo:{
entry:'src/pages/projectVideo.js',
template:'public/video.html',
title:'视频管理',
filename:'projectVideo.html'
2023-09-17 23:29:27 +08:00
},
projectEngin:{
entry:'src/pages/projectEngin.js',
template:'public/index.html',
title:'工程管理',
filename:'projectEngin.html'
2023-08-10 01:16:23 +08:00
}
2023-10-03 21:31:40 +08:00
},*/
2024-08-11 23:01:48 +08:00
configureWebpack:(config)=>{
config.externals={
2023-12-23 23:34:48 +08:00
'vue':"Vue"
2023-08-10 01:16:23 +08:00
}
2024-08-11 23:01:48 +08:00
if (process.env.NODE_ENV === 'production') {
config.plugins.push(
new WebpackObfuscator(
{
rotateStringArray: true, // 旋转字符串数组
stringArray: true, // 使用字符串数组
stringArrayEncoding: ['rc4'], // 字符串数组编码rc4 是一个强加密算法)
stringArrayThreshold: 0.75, // 混淆代码中的字符串百分比
deadCodeInjection: true, // 注入死代码
deadCodeInjectionThreshold: 0.4, // 死代码注入比例
unicodeEscapeSequence: false, // 使用Unicode转义序列
debugProtection: true, // 防止浏览器的开发者工具调试
disableConsoleOutput: true, // 禁用 console.log、console.info 等输出
},
[] // 需要排除混淆的文件
)
)
}
2023-08-10 01:16:23 +08:00
},
})