alibaba / alibaba/ice

[Vite] entry 为 object 时启动报错

Open
#5,237 1 comment 0 reactions 1 assignee Claimed by @ClarkXia View on GitHub
bug
Dominant language
TypeScript
Stars
18.6k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Description

## What is the current behavior? 发生了什么?

当项目配置 entry 为 object 且 vite 模式开启:

```json
{
"entry": {
"pages/marketing/cashBack/index": "src/pages/marketing/cashBack/index.jsx",
"pages/customContact/index": "src/pages/customContact/index.jsx",
"pages/customFeeContact/index": "src/pages/customFeeContact/index.jsx",
"pages/data/index": "src/pages/data/index.jsx",
"pages/npo/index": "src/pages/npo/index.jsx",
"pages/po/index": "src/pages/po/index.jsx"
},
"vite": true
}
```

运行 npm start 报错:

```
ERR! entry.includes is not a function
TypeError: entry.includes is not a function
at getEntry (/Users/guoyunhe/Git/ota-po/node_modules/@builder/vite-service/lib/plugins/html.js:66:19)
at htmlPlugin (/Users/guoyunhe/Git/ota-po/node_modules/@builder/vite-service/lib/plugins/html.js:72:16)
at getHtmlPlugin (/Users/guoyunhe/Git/ota-po/node_modules/@builder/vite-service/lib/wp2vite/index.js:62:41)
at wp2vite (/Users/guoyunhe/Git/ota-po/node_modules/@builder/vite-service/lib/wp2vite/index.js:142:13)
at /Users/guoyunhe/Git/ota-po/node_modules/@builder/vite-service/lib/start.js:51:78
at step (/Users/guoyunhe/Git/ota-po/node_modules/@builder/vite-service/lib/start.js:33:23)
at Object.next (/Users/guoyunhe/Git/ota-po/node_modules/@builder/vite-service/lib/start.js:14:53)
at /Users/guoyunhe/Git/ota-po/node_modules/@builder/vite-service/lib/start.js:8:71
at new Promise ()
at __awaiter (/Users/guoyunhe/Git/ota-po/node_modules/@builder/vite-service/lib/start.js:4:12)
```

## What is the expected behavior? 期望的结果是什么?

## Any additional comments? 相关环境信息?

- **ice.js Version**:
- **build.json Configuration**:
- **Node Version**:
- **Platform**:

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.