Menu

devIndicators

当你编辑代码且 Next.js 正在编译应用程序时,页面右下角会出现一个编译指示器。

值得注意的是:此指示器仅在开发模式下出现,在生产模式下构建和运行应用程序时不会出现。

在某些情况下,此指示器可能会在你的页面上的位置不正确,例如,当与聊天启动器冲突时。要更改其位置,请打开 next.config.js 并将 devIndicators 对象中的 buildActivityPosition 设置为 bottom-right(默认)、bottom-lefttop-righttop-left

next.config.js
module.exports = {
  devIndicators: {
    buildActivityPosition: "bottom-right",
  },
};

在某些情况下,此指示器可能对你没有用处。要移除它,请打开 next.config.js 并在 devIndicators 对象中禁用 buildActivity 配置:

next.config.js
module.exports = {
  devIndicators: {
    buildActivity: false,
  },
};

还有一个指示器显示页面是否会在开发期间的构建中预渲染。可以通过点击每个页面来隐藏它,但如果你永远不想显示它,可以禁用它:

next.config.js
module.exports = {
  devIndicators: {
    appIsrStatus: false,
  },
};