首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何打开性能优化在反应本土android?

如何打开性能优化在反应本土android?
EN

Stack Overflow用户
提问于 2017-01-28 18:01:48
回答 1查看 6K关注 0票数 4

每当我运行我的应用程序时,我总是在我的开发工具中看到

DEV === true,启动开发级别警告,关闭性能优化。

如何将性能优化设置为ON和DEV为False?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-01-28 19:02:17

当您创建生产javascript时,DEV模式将自动关闭。通常,您不需要自己动手,因为当您运行XCode存档任务或Android部署时,包程序会创建包。

但是,您可以使用react-native bundle --dev=false命令手动创建包。

代码语言:javascript
复制
react-native bundle --dev=false --entry-file=index.ios.js --bundle-output=app.jsbundle --platform=ios

bundle命令接受以下选项:

代码语言:javascript
复制
react-native bundle [options]
builds the javascript bundle for offline use

Options:

  -h, --help                   output usage information
  --entry-file <path>          Path to the root JS file, either absolute or relative to JS root
  --platform [string]          Either "ios" or "android"
  --transformer [string]       Specify a custom transformer to be used
  --dev [boolean]              If false, warnings are disabled and the bundle is minified
  --bundle-output <string>     File name where to store the resulting bundle, ex. /tmp/groups.bundle
  --bundle-encoding [string]   Encoding the bundle should be written in (https://nodejs.org/api/buffer.html#buffer_buffer).
  --sourcemap-output [string]  File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map
  --assets-dest [string]       Directory name where to store assets referenced in the bundle
  --verbose                    Enables logging
  --reset-cache                Removes cached files
  --read-global-cache          Try to fetch transformed JS code from the global cache, if configured.
  --config [string]            Path to the CLI configuration file
票数 7
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41913016

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档