|
@@ -23,12 +23,12 @@ function isProd () {
|
|
|
}
|
|
|
|
|
|
// 项目部署基础
|
|
|
-// 默认情况下,我们假设你的应用将被部署在域的根目录下,
|
|
|
+// 默认情况下,我们假设你的应用将被部署在域的根目录丄1�7
|
|
|
// 例如:https://www.my-app.com/
|
|
|
-// 默认:'/'
|
|
|
+// 默认$1�7/'
|
|
|
// 如果您的应用程序部署在子路径中,则需要在这指定子路径
|
|
|
// 例如:https://www.foobar.com/my-app/
|
|
|
-// 需要将它改为'/my-app/'
|
|
|
+// 霄1�7要将它改丄1�7/my-app/'
|
|
|
const BASE_URL = isProd ? '/' : '/'
|
|
|
const assetsCDN = {
|
|
|
css: [],
|
|
@@ -59,14 +59,14 @@ const prodExternals = {
|
|
|
|
|
|
// vue.config.js
|
|
|
const vueConfig = {
|
|
|
- runtimeCompiler: true, // 动态编译组件
|
|
|
+ runtimeCompiler: true, // 动��1�7�编译组仄1�7
|
|
|
publicPath: BASE_URL,
|
|
|
configureWebpack: {
|
|
|
optimization: isProd() ? {
|
|
|
minimize: true,
|
|
|
minimizer: [new TerserPlugin({
|
|
|
- test: /\.js(\?.*)?$/i, // 匹配参与压缩的文件
|
|
|
- parallel: true, // 使用多进程并发运行
|
|
|
+ test: /\.js(\?.*)?$/i, // 匹配参与压缩的文仄1�7
|
|
|
+ parallel: true, // 使用多进程并发运衄1�7
|
|
|
terserOptions: { // Terser 压缩配置
|
|
|
output: { comments: false },
|
|
|
compress: {// console删除
|
|
@@ -81,15 +81,15 @@ const vueConfig = {
|
|
|
// Ignore all locale files of moment.js
|
|
|
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
|
|
|
new compressionWebpackPlugin({
|
|
|
- // [file] 会被替换成原始资源。[path] 会被替换成原始资源的路径, [query] 会被替换成查询字符串。默认值是 "[path].gz[query]"。
|
|
|
+ // [file] 会被替换成原始资源��1�7�[path] 会被替换成原始资源的路径$1�7[query] 会被替换成查询字符串。默认��1�7�是 "[path].gz[query]"〄1�7
|
|
|
filename: '[path].gz[query]', // 提示compression-webpack-plugin@3.0.0的话asset改为filename
|
|
|
- // 可以是 function(buf, callback) 或者字符串。对于字符串来说依照 zlib 的算法(或者 zopfli 的算法)。默认值是 "gzip"。
|
|
|
+ // 可以昄1�7function(buf, callback) 或��1�7�字符串。对于字符串来说依照 zlib 的算泄1�7或��1�7�1�7zopfli 的算泄1�7。默认��1�7�是 "gzip"〄1�7
|
|
|
algorithm: 'gzip',
|
|
|
- // 所有匹配该正则的资源都会被处理。默认值是全部资源。
|
|
|
+ // 扄1�7有匹配该正则的资源都会被处理。默认��1�7�是全部资源〄1�7
|
|
|
test: new RegExp('\\.(' + ['js', 'css'].join('|') + ')$'),
|
|
|
- // 只有大小大于该值的资源会被处理。单位是 bytes。默认值是 0。
|
|
|
+ // 只有大小大于该��1�7�的资源会被处理。单位是 bytes。默认��1�7�是 0〄1�7
|
|
|
threshold: 10240,
|
|
|
- // 只有压缩率小于这个值的资源才会被处理。默认值是 0.8。
|
|
|
+ // 只有压缩率小于这个��1�7�的资源才会被处理��1�7�默认��1�7�是 0.8〄1�7
|
|
|
minRatio: 0.8
|
|
|
}),
|
|
|
new WebpackVersionPlugin({
|
|
@@ -136,16 +136,16 @@ const vueConfig = {
|
|
|
|
|
|
config.optimization && config.optimization.splitChunks({
|
|
|
// 拆包配置
|
|
|
- chunks: 'all', // 三选一:"initial" 初始化,"all"(默认就是all),"async"(动态加载)
|
|
|
- minSize: 30000, // 形成一个新代码块最小的体积,只有 >= minSize 的bundle会被拆分出来 30000
|
|
|
- maxSize: 0, // 拆分之前最大的数值,默认为0,即不做限制
|
|
|
- minChunks: 1, // 引入次数,如果为2 那么一个资源最少被引用两次才可以被拆分出来
|
|
|
+ chunks: 'all', // 三��1�7�一$1�7initial" 初始化,"all"(默认就是all)$1�7async"(动态加载)
|
|
|
+ minSize: 30000, // 形成丄1�7个新代码块最小的体积,只有 >= minSize 的bundle会被拆分出来 30000
|
|
|
+ maxSize: 0, // 拆分之前朄1�7大的数��1�7�,默认丄1�7�即不做限制
|
|
|
+ minChunks: 1, // 引入次数,如果为2 那么丄1�7个资源最少被引用两次才可以被拆分出来
|
|
|
maxAsyncRequests: 5, // 按需加载的最大并行请求数
|
|
|
- maxInitialRequests: 4, // 一个入口最大并行请求数
|
|
|
- automaticNameDelimiter: '~', // 文件名的连接符
|
|
|
+ maxInitialRequests: 4, // 丄1�7个入口最大并行请求数
|
|
|
+ automaticNameDelimiter: '~', // 文件名的连接笄1�7
|
|
|
name: true,
|
|
|
cacheGroups: {
|
|
|
- // node_modules模块包
|
|
|
+ // node_modules模块匄1�7
|
|
|
vendors: {
|
|
|
test: /[\\/]node_modules[\\/]/,
|
|
|
name: 'chunk-vendors',
|
|
@@ -156,7 +156,7 @@ const vueConfig = {
|
|
|
chunks: 'all',
|
|
|
priority: -10
|
|
|
},
|
|
|
- // UI库单独拆包
|
|
|
+ // UI库单独拆匄1�7
|
|
|
antDesign: {
|
|
|
name: 'chunk-antDesign',
|
|
|
priority: 19, // the weight needs to be larger than libs and app or it will be packaged into libs or app
|
|
@@ -171,7 +171,7 @@ const vueConfig = {
|
|
|
common: {
|
|
|
name: 'chunk-common',
|
|
|
minChunks: 2,
|
|
|
- maxSize: 1024, // 拆分之前最大的数值,默认为0,即不做限制
|
|
|
+ maxSize: 1024, // 拆分之前朄1�7大的数��1�7�,默认丄1�7�即不做限制
|
|
|
priority: -20,
|
|
|
reuseExistingChunk: true
|
|
|
}
|
|
@@ -209,8 +209,8 @@ const vueConfig = {
|
|
|
// If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
|
|
|
proxy: {
|
|
|
'/api': {
|
|
|
- target: 'http://192.168.2.103/qpls-md',
|
|
|
- // target: 'https://p.iscm.360arrow.com/qpls-md',
|
|
|
+ // target: 'http://192.168.2.103/qpls-md',
|
|
|
+ target: 'https://p.iscm.360arrow.com/qpls-md',
|
|
|
// ws: false,
|
|
|
ws: true,
|
|
|
changeOrigin: true,
|