|
|
|
@ -19,6 +19,15 @@ export default ({ mode, command }) => { |
|
|
|
|
|
|
|
|
|
|
|
// 如果是生产环境,添加Terser的配置
|
|
|
|
// 如果是生产环境,添加Terser的配置
|
|
|
|
if (isProd) { |
|
|
|
if (isProd) { |
|
|
|
|
|
|
|
const now = new Date(); |
|
|
|
|
|
|
|
const timestamp = [ |
|
|
|
|
|
|
|
now.getFullYear(), |
|
|
|
|
|
|
|
String(now.getMonth() + 1).padStart(2, '0'), |
|
|
|
|
|
|
|
String(now.getDate()).padStart(2, '0'), |
|
|
|
|
|
|
|
String(now.getHours()).padStart(2, '0'), |
|
|
|
|
|
|
|
String(now.getMinutes()).padStart(2, '0'), |
|
|
|
|
|
|
|
String(now.getSeconds()).padStart(2, '0') |
|
|
|
|
|
|
|
].join(''); |
|
|
|
buildConfig.terserOptions = { |
|
|
|
buildConfig.terserOptions = { |
|
|
|
compress: { |
|
|
|
compress: { |
|
|
|
drop_console: true, // 删除 console
|
|
|
|
drop_console: true, // 删除 console
|
|
|
|
@ -30,6 +39,10 @@ export default ({ mode, command }) => { |
|
|
|
}; |
|
|
|
}; |
|
|
|
buildConfig.rollupOptions = { |
|
|
|
buildConfig.rollupOptions = { |
|
|
|
output: { |
|
|
|
output: { |
|
|
|
|
|
|
|
// 添加带时间戳的文件名
|
|
|
|
|
|
|
|
entryFileNames: `assets/[name].${timestamp}.js`, |
|
|
|
|
|
|
|
chunkFileNames: `assets/[name].${timestamp}.js`, |
|
|
|
|
|
|
|
assetFileNames: `assets/[name].${timestamp}[extname]`, |
|
|
|
manualChunks: { |
|
|
|
manualChunks: { |
|
|
|
'element-plus': ['element-plus'], |
|
|
|
'element-plus': ['element-plus'], |
|
|
|
'@smallwei/avue': ['@smallwei/avue'], |
|
|
|
'@smallwei/avue': ['@smallwei/avue'], |
|
|
|
@ -51,7 +64,7 @@ export default ({ mode, command }) => { |
|
|
|
// target: 'http://192.168.1.5:82',
|
|
|
|
// target: 'http://192.168.1.5:82',
|
|
|
|
// target: "http://192.168.1.4:82",
|
|
|
|
// target: "http://192.168.1.4:82",
|
|
|
|
// target:'http://49.232.74.228:82',
|
|
|
|
// target:'http://49.232.74.228:82',
|
|
|
|
// target: "http://192.168.0.120",
|
|
|
|
// target: "http://192.168.0.103",
|
|
|
|
//target: 'https://saber3.bladex.cn/api',
|
|
|
|
//target: 'https://saber3.bladex.cn/api',
|
|
|
|
// target: 'http://49.232.74.228:82',
|
|
|
|
// target: 'http://49.232.74.228:82',
|
|
|
|
// target: "http:192.168.0.220:80",
|
|
|
|
// target: "http:192.168.0.220:80",
|
|
|
|
|