alibaba / alibaba/ice

希望支持.cjs 扩展名的编译

Open
#7,181 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
18.6k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

我项目里引入了animejs包,它的模块解析链路是dist/modules/index.cjs,因为compileDependencies不支持.cjs文件的转义,在一些低版本手机比如iphone12里一些高级语法比如可选链 `?.`就无法执行会报错

### Expected behavior

ice3 框架支持.cjs 扩展名的编译

### Actual behavior

_No response_

### Version of ice.js

3.4.10

### Content of build.json or ice.config.mts

```TypeScript

```

### Additional context

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the compileDependencies entry point and reproduce the issue with animejs resolving to dist/modules/index.cjs. Check the build behavior for optional chaining on the reported older iPhone environment, and consider the work complete when .cjs dependencies are compiled and the resulting code executes there.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.