[英]React-native transformer taking too much time
I am using react-native with scala.js. 我在scala.js中使用react-native。 Here is the gist of my index.ios.js and package.json files. 这是我的index.ios.js和package.json文件的要点 。
Transform statistics : 转换统计信息:
[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)
It took almost ~20 seconds to transform and for every small change I make I have to wait the same amount of time. 转换花费了将近20秒钟的时间,对于每一次小的更改,我都必须等待相同的时间。
How can I improve this time? 我该如何改善?
Here is the solution for this problem : https://github.com/facebook/react-native/issues/6830 这是此问题的解决方案: https : //github.com/facebook/react-native/issues/6830
Edit : 编辑:
Root cause for the issue is babel.transform didn't like my scala.js output, to fix this modify transform.js file packager. 问题的根本原因是babel.transform不喜欢我的scala.js输出,以解决此修改transform.js文件打包程序的问题。
const result = babel.transform(src, babelConfig);
|
To
const result = filename.indexOf("index.ios.js") > -1 ? {code : src} : babel.transform(src, babelConfig);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.