Sup*_*acy 3 react-native react-native-android
每当我运行应用程序时,我总是会在开发人员工具中看到
DEV === true,开发级别警告为ON,性能优化为OFF
如何将“性能优化”设置为“开”并将DEV设置为“假”?
DEV创建生产javascript捆绑包时,该模式会自动关闭。通常,您不需要自己执行此操作,因为打包程序在运行XCode Archive任务或Android部署时会创建捆绑包。
但是,您可以使用以下react-native bundle --dev=false命令手动创建捆绑包,例如
react-native bundle --dev=false --entry-file=index.ios.js --bundle-output=app.jsbundle --platform=ios
Run Code Online (Sandbox Code Playgroud)
该bundle命令采用以下选项:
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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4874 次 |
| 最近记录: |