> For AI agents: the complete documentation index is available at /zh/llms.txt, the full documentation bundle is available at /zh/llms-full.txt.

# source.entriesDir

- **类型：** `string`
- **默认值：** `'./src'`

Modern.js 默认会扫描 `src` 目录来识别页面入口，你可以通过该选项自定义页面入口的识别目录。

例如，当配置与目录结构如下时：

```ts title="modern.config.ts"
export default defineConfig({
  source: {
    entriesDir: './src/pages',
  },
});
```

```bash title="项目目录结构"
.
└── src
    └── pages
        ├── a
        │   └── App.tsx
        └── b
            └── App.tsx
```

Modern.js 会扫描 `./src/pages` 目录，自动生成构建入口 `a` 和入口 `b`，结果如下：

```js
const entry = {
  a: './src/pages/a/App.tsx',
  b: './src/pages/b/App.tsx',
};
```
