Vue

※前提条件:本文基于 Vue 2.0 创作

npm run build: WARNING in asset size limit: The following asset(s) exceed the recommended size limit [edit]

webpack升级webpack4后打包出现文件大小警告提示。

实际项目中没有 webpack.config.js 文件时,修改webpack.base.config.js文件中配置

module.exports = {
  performance: {
    hints: 'warning',
    //入口起点的最大体积 整数类型(以字节为单位)
    maxEntrypointSize: 50000000,
    //生成文件的最大体积 整数类型(以字节为单位 300k)
    maxAssetSize: 30000000,
    //只给出 js 文件的性能提示
    assetFilter: function(assetFilename) {
      return assetFilename.endsWith('.css') || assetFilename.endsWith('.js');
    }
  },
  mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
  context: path.resolve(__dirname, '../'),
  entry: {
    app:  ["babel-polyfill", "./src/main.js"]
  },
........
}

コメント:



(画像の文字列を入力して下さい)

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS