调整本地项目加入新房间失败提示&除dev其他打包开启gzip
This commit is contained in:
parent
358c3dce46
commit
8e3d9b541c
@ -51,7 +51,7 @@
|
||||
"babel-preset-env": "1.6.1",
|
||||
"babel-preset-stage-2": "6.24.1",
|
||||
"chalk": "2.4.2",
|
||||
"compression-webpack-plugin": "^3.0.0",
|
||||
"compression-webpack-plugin": "^3.1.0",
|
||||
"connect": "3.6.6",
|
||||
"copy-webpack-plugin": "^4.5.2",
|
||||
"eslint": "5.15.3",
|
||||
|
@ -233,5 +233,6 @@ export default {
|
||||
stopPointOffsetTip: 'Set block stop offset in bulk successfully!',
|
||||
mapSortSuccessfully: 'Map sort successfully!',
|
||||
mapSortFailed: 'Map sort failed',
|
||||
enterTrainingRoomFailed: 'Failed to enter the comprehensive drill, please consult the administrator is still in the room!'
|
||||
enterTrainingRoomFailed: 'Failed to enter the comprehensive drill, please consult the administrator is still in the room!',
|
||||
failedToAddNewRoom: 'Failed to add new room'
|
||||
};
|
||||
|
@ -233,5 +233,6 @@ export default {
|
||||
stopPointOffsetTip: '批量设置区段停车点偏移量成功!',
|
||||
mapSortSuccessfully: '地图排序成功!',
|
||||
mapSortFailed: '地图排序失败!',
|
||||
enterTrainingRoomFailed: '进入综合演练失败,请咨询管理员是否还在房间内!'
|
||||
enterTrainingRoomFailed: '进入综合演练失败,请咨询管理员是否还在房间内!',
|
||||
failedToAddNewRoom: '加入新房间失败'
|
||||
};
|
||||
|
@ -45,7 +45,8 @@ export default {
|
||||
}
|
||||
this.dialogShow = false;
|
||||
} catch (error) {
|
||||
this.$messageBox(`${this.$t('error.scanningError')}:${error.message}`);
|
||||
const errorMessage = this.isShow ? this.$t('tip.failedToAddNewRoom') : this.$t('error.scanningError');
|
||||
this.$messageBox(`${errorMessage}:${error.message}`);
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ const defaultSettings = require('./src/settings.js');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const webpack = require('webpack');
|
||||
|
||||
// const CompressionPlugin = require('compression-webpack-plugin');
|
||||
const CompressionPlugin = require('compression-webpack-plugin');
|
||||
// const productionGzipExtensions = ['js', 'css'];
|
||||
// const isProduction = process.env.NODE_ENV === 'production';
|
||||
|
||||
@ -86,6 +86,16 @@ module.exports = {
|
||||
// // 为开发环境修改配置...
|
||||
// config.mode = 'development';
|
||||
// }
|
||||
if (process.env.NODE_ENV !== 'development') {
|
||||
config.plugins.push(new CompressionPlugin({
|
||||
filename: '[path].gz[query]',
|
||||
algorithm: 'gzip',
|
||||
test:/\.js$|\.html$|.\css/, // 匹配文件名
|
||||
threshold: 10240, // 对超过10k的数据压缩
|
||||
minRatio: 0.8, // 只有压缩好这个比率的资产才能被处理
|
||||
deleteOriginalAssets: true
|
||||
}));
|
||||
}
|
||||
config.name = name;
|
||||
config.resolve = {
|
||||
extensions: ['.js', '.vue', '.json'],
|
||||
|
Loading…
Reference in New Issue
Block a user