简体   繁体   English

反应堆本机需要太多时间

[英]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.

相关问题 React-Native onSubmitEditting 执行时间太长 function - React-Native onSubmitEditting taking too much time to execute function react-native run-android 在我的 android 设备上安装花费了太多时间 - react-native run-android is taking too much time on installaion on my android device agora.io react-native setEnableSpeakerphone 花费太多时间 - agora.io react-native setEnableSpeakerphone is taking too much time React-native run-android 耗时太多 - React-native run-android take too much time React Native Fingerprint Scanner 花费太多时间进行身份验证 - React Native Fingerprint Scanner taking too much time to authenticate 自定义列表视图在页面加载上花费了太多时间反应本机 - Custom List View is taking too much time on page load react native 使用react-native init项目来响应本机太多问题 - React native too much problem using react-native init project XCode + React-native:“捆绑 React Native 代码和图像”构建阶段耗时过长 - XCode + React-native: "Bundle React Native code and images" build phase taking too long React-native 地图:带有动画 API 的 MapView 在 android 中滞后太多 - React-native map: MapView with the Animated API is lagging too much in android react-native metro error 'Failed to construct transformer' - react-native metro error 'Failed to construct transformer'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM