---
title: "NUXT_B5004"
description: "不支持外部配置文件"
canonical_url: "https://nuxt.zhcndoc.com/docs/4.x/errors/b5004"
---
# B5004

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

## 解决方案

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

- `vite.config`：使用 `vite` 键
- `webpack.config`：使用 `webpack` 键
- `nitro.config`：使用 `nitro` 键
- `postcss.config`：使用 `postcss` 键

```ts
export default defineNuxtConfig({
  vite: {
    // 你的 Vite 配置在这里
  },
})
```

::read-more{to="https://nuxt.zhcndoc.com/docs/4.x/getting-started/configuration"}
::


## Sitemap

See the full [sitemap](https://nuxt.zhcndoc.com/sitemap.md) for all pages.
