baidu / baidu/amis

将factoryMap支持外部自定义过滤引用

Open
#3,984 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

#### 是否关联于某个问题吗:

因为我要在amis里使用antd-mobile。但直接引进来会报错,”找不到node_modules/antd-mobile/cjs/global里的global.css“。
于是我修改了example/mod.js里的下面代码部分,加了过滤条件。虽然这样临时能用,但可能编译后也需要修改代码。所以有没有个地方能直接修改这里。如果没有,能否给个口子。因为很多包amis引进来都会报错。

```
//
// init module
//
var factory = factoryMap[id];
if (!factory && !/^node_modules\/antd-mobile\/cjs\/.*\.css$/g.test(id)) {
throw '[ModJS] Cannot find module `' + id + '`';
}
```

#### 预期的解决方案:
请简单描述你想达到的效果...

#### 其他可接受方案:
请简单描述其他你可以接受的效果...

#### 任何附加信息:
请添加任何可以补充说明上述问题的材料,例如图片或视频等...

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with example/mod.js and trace how factoryMap is initialized and how missing module IDs are handled. Determine where an external filter or configuration hook could be exposed without editing generated code, then verify that the antd-mobile CSS case can be handled through that hook and that normal missing-module errors still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.