NUXT_B5004

不支持外部配置文件

Maschinelle Übersetzung ·0 % geprüft

B5004

Nuxt 在你的 nuxt.config 旁边发现了一个独立的 vite.config 或 webpack.config 文件。Nuxt 会在内部管理打包工具,并忽略这些文件,因此它们通常是迁移后遗留的内容,或者是从非 Nuxt 项目复制过来的。

从 vite-plus 导入内容的 vite.config 文件不会触发此警告,因为它配置的是 Vite+ 命令,而非 Nuxt 应用。

解决方案

将配置移动到 nuxt.config 中对应的键下,然后删除外部文件:

  • vite.config:使用 vite 键
  • webpack.config:使用 webpack 键
  • nitro.config:使用 nitro 键
  • postcss.config:使用 postcss 键
export default defineNuxtConfig({
  vite: {
    // 你的 Vite 配置在这里
  },
})
Weitere Informationen findest du unter Docs > Getting Started > Configuration.

Was this helpful?