发布时间:2023-06-11 19:00
webpack打包提示文件体积过大导致
The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
修改下打包时的配置:
config["performance"] = { "maxEntrypointSize": 10000000, "maxAssetSize": 30000000 }
module.exports = {
publicPath: './', // 基本路径
outputDir: 'dist', // 输出文件目录
assetsDir: "static", //放置生成的静态文件目录(js css img)
productionSourceMap: false, // 生产环境是否生成 sourceMap 文件
chainWebpack: config => {
config.resolve.alias
.set('@', resolve('src'))
.set('assets', resolve('src/assets'))
.set('components', resolve('src/components'))
},
configureWebpack: (config) => {
if (process.env.NODE_ENV === 'production') {// 为生产环境修改配置...
config.mode = 'production';
config["performance"] = {//打包文件大小配置
"maxEntrypointSize": 10000000,
"maxAssetSize": 30000000
}
}
}
}
【第27天】给定一个整数 n ,打印出1到n的全排列 | 全排列模板
DEVOPS架构师 -- 05从零开始构建基于Kubernetes的DevOps平台
字节面试官:“这92道 Spring Boot 面试题都答不上来?”
python关于sorted排序函数详细解析 附实战代码(全)
Python OpenCV Hough直线检测算法的原理实现
VS code 安装VUE3 模板报错The template rootrequires exactly one element. eslint -plugin-vue