【问题标题】:Warning: data for page "/blog/....") is 569 kB which exceeds the threshold of 128 kB, this amount of data can reduce performance警告:页面 \"/blog/....\") 的数据为 569 kB,超过了 128 kB 的阈值,此数据量会降低性能
【发布时间】:2022-11-21 17:32:57
【问题描述】:

在不使用 largePageDataBytes 的 mdx 文件的 nextjs 中,处理“警告:页面“/blog/....”的数据”的最佳方法是 569 kB,超过了 128 kB 的阈值,这个数据量会降低性能”在 next.config.js 中。我正在为 mdx 文件使用 mdx-bundler。

【问题讨论】:

    标签: next.js vercel mdxjs


    【解决方案1】:

    警告是有原因的,我建议找到减少页面数据的解决方案。

    作为记录,阈值“可以”通过 next.config.js 增加

    const nextConfig = {
      ...
      experimental: {
      //largePageDataBytes: 128 * 1000, // 128KB by default
        largePageDataBytes: 128 * 100000,
      },
      ...
    }
    

    【讨论】:

      猜你喜欢
      • 2011-04-13
      • 1970-01-01
      • 2023-03-03
      • 2020-12-21
      • 2021-04-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-18
      相关资源
      最近更新 更多