React native 反应本机转换器花费太多时间

React native 反应本机转换器花费太多时间,react-native,React Native,我将react native与scala.js一起使用。下面是我的index.ios.js和package.json文件的详细信息 转换统计信息: [12:20:44 PM] <END> request:/index.ios.bundle?platform=ios&dev=true (700ms) [12:20:58 PM] <START> find dependencies [12:20:59 PM] <END> find depende

我将react native与scala.js一起使用。下面是我的index.ios.js和package.json文件的详细信息

转换统计信息:

[12:20:44 PM] <END>   request:/index.ios.bundle?platform=ios&dev=true (700ms) 
[12:20:58 PM] <START> find dependencies 
[12:20:59 PM] <END>   find dependencies (443ms) 
[12:20:59 PM] <START> transform transforming [========================================] 100% 524/525
[12:21:05 PM] <START> request:/index.ios.bundle?platform=ios&dev=true transforming [========================================] 100% 525/525 [12:21:24 PM] <END>   transform (25137ms) 
[12:21:24 PM] <END>   request:/index.ios.bundle?platform=ios&dev=true (19293ms)
[12:20:44 PM]请求:/index.ios.bundle?platform=ios&dev=true(700ms)
[12:20:58 PM]查找依赖项
[12:20:59 PM]查找依赖项(443ms)
[12:20:59 PM]变换变换[====================================================================================]100%524/525
[12:21:05 PM]请求:/index.ios.bundle?platform=ios&dev=true转换[=================================================================================]100%525/525[12:21:24 PM]转换(25137ms)
[12:21:24 PM]请求:/index.ios.bundle?platform=ios&dev=true(19293ms)
转换几乎需要20秒,对于我所做的每一个小更改,我都必须等待相同的时间


这次如何改进?

以下是解决此问题的方法:

编辑:

问题的根本原因是babel.transform不喜欢我的scala.js输出,要修复这个modify transform.js文件打包程序

const result = babel.transform(src, babelConfig);
                           |
                          To
 const result = filename.indexOf("index.ios.js") > -1 ? {code : src}  : babel.transform(src, babelConfig);

@我是那些投了否决票的人之一,因为在4.4k代表之后,你应该知道如何回答问题,并且只发布链接答案是不可接受的(这甚至是低质量评论队列中的标准删除原因之一)。既然你编辑了你的帖子,我就不再投反对票了。写下你的下一个答案时,请记住弗洛恩说的话。@Adrian谢谢你的回答,不管我们有多大的代表性,我们总是犯错误!如果我遇到这种情况,我不会投反对票,因为链接是有意义的(不同的人,不同的思维过程,是的…)。