打包警告:asset size limit: The following asset(s) exceed the recommended size limit (244 KiB)

打包警告:asset size limit: The following asset(s) exceed the recommended size limit (244 KiB)
打包警告:解决办法
1.打包继续压缩

vue.config.js
(当然你得先去安装一下)
//npm i -D compression-webpack-plugin

const CompressionWebpackPlugin = require('compression-webpack-plugin');

打包警告:asset size limit: The following asset(s) exceed the recommended size limit (244 KiB)

config.plugin('compression-webpack-plugin').use(new CompressionWebpackPlugin({
                test: /\.(js|css|scss)$/, // 匹配文件名
                threshold: 20480, // 对超过20k的数据压缩
                minRatio: 0.8,
                deleteOriginalAssets: true // 删除源文件
            }))

第2个就是关掉警告
.打包警告:asset size limit: The following asset(s) exceed the recommended size limit (244 KiB)

 config["performance"] = {
            hints: "warning",
            maxEntrypointSize: 10000000,
            maxAssetSize: 30000000,
            assetFilter: function (assetFilename) {
                // 提供资源文件名的断言函数
                return assetFilename.endsWith('.css') || assetFilename.endsWith('.js');

            }
        };
上一篇:上古神器WireGuard异地高效率组网


下一篇:MySQL的介绍以及安装步骤