From ef4d6420f37fbdd894d83a262bf562245c82d16f Mon Sep 17 00:00:00 2001 From: wangxiaoshuang <825034831@qq.com> Date: Sat, 8 Feb 2025 15:42:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BE=8E=E5=9B=BDuat=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=94=B9=EF=BC=8C=E4=BD=BF=E7=94=A8?= =?UTF-8?q?gzip=E5=8E=8B=E7=BC=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.usa | 2 +- vue.config.js | 44 ++++++++++++++++++++++---------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.env.usa b/.env.usa index da074d35..2ff02d8b 100644 --- a/.env.usa +++ b/.env.usa @@ -2,7 +2,7 @@ ENV = 'usa' NODE_ENV = 'usa' # base public path -VUE_APP_BASE_PATH = 'https://ei-med-s3-uat-code.s3.amazonaws.com/2025-01-24/' +VUE_APP_BASE_PATH = 'https://d3taa4kz0xxv95.cloudfront.net/2025-01-23/' # 是否开启登陆限制 true:是 false:否 VUE_APP_LOGIN_FOR_PERMISSION = true diff --git a/vue.config.js b/vue.config.js index 96533d9e..72dbc587 100644 --- a/vue.config.js +++ b/vue.config.js @@ -159,28 +159,28 @@ module.exports = { config.plugins.delete('preload') // TODO: need test config.plugins.delete('prefetch') // TODO: need test // set svg-sprite-loader - // config.optimization.splitChunks({ - // chunks: "initial", //async异步代码分割 initial同步代码分割 all同步异步分割都开启 - // minSize: 30000, //字节 引入的文件大于30kb才进行分割 - // //maxSize: 50000, //50kb,尝试将大于50kb的文件拆分成n个50kb的文件 - // minChunks: 1, //模块至少使用次数 - // maxAsyncRequests: 5, //同时加载的模块数量最多是5个,只分割出同时引入的前5个文件 - // maxInitialRequests: 3, //首页加载的时候引入的文件最多3个 - // automaticNameDelimiter: '~', //缓存组和生成文件名称之间的连接符 - // name: true, //缓存组里面的filename生效,覆盖默认命名 - // cacheGroups: { //缓存组,将所有加载模块放在缓存里面一起分割打包 - // vendors: { //自定义打包模块 - // test: /[\\/]node_modules[\\/]/, - // priority: -10, //优先级,先打包到哪个组里面,值越大,优先级越高 - // filename: 'vendors.js', - // }, - // default: { //默认打包模块 - // priority: -20, - // reuseExistingChunk: true, //模块嵌套引入时,判断是否复用已经被打包的模块 - // filename: 'common.js' - // } - // } - // }) + config.optimization.splitChunks({ + chunks: "initial", //async异步代码分割 initial同步代码分割 all同步异步分割都开启 + minSize: 30000, //字节 引入的文件大于30kb才进行分割 + maxSize: 5000000, //50kb,尝试将大于50kb的文件拆分成n个50kb的文件 + minChunks: 1, //模块至少使用次数 + maxAsyncRequests: 30, //同时加载的模块数量最多是5个,只分割出同时引入的前5个文件 + maxInitialRequests: 30, //首页加载的时候引入的文件最多3个 + automaticNameDelimiter: '_', //缓存组和生成文件名称之间的连接符 + name: true, //缓存组里面的filename生效,覆盖默认命名 + cacheGroups: { //缓存组,将所有加载模块放在缓存里面一起分割打包 + vendors: { //自定义打包模块 + test: /[\\/]node_modules[\\/]/, + priority: -10, //优先级,先打包到哪个组里面,值越大,优先级越高 + filename: 'vendors.js', + }, + default: { //默认打包模块 + priority: -20, + reuseExistingChunk: true, //模块嵌套引入时,判断是否复用已经被打包的模块 + filename: 'common.js' + } + } + }) config.module .rule('svg') .exclude.add(resolve('src/icons'))