首页 > 学院 > 开发设计 > 正文

ReactNative 安卓打包发布

2019-11-09 18:44:25
字体:
来源:转载
供稿:网友

ReactNative 安卓打包发布

截图

截图

react-native bundle 命令

react-native bundleOptions:--entry-file Path to the root JS file, either absolute or relative to JS root [required]--platform Either "ios" or "android"--transformer Specify a custom transformer to be used (absolute path) [default: "/Users/babytree-mbp13/PRojects/xcodeProjects/AwesomeProject/node_modules/react-native/packager/transformer.js"]--dev If false, warnings are disabled and the bundle is minified [default: true]--prepack If true, the output bundle will use the Prepack format. [default: false]--bridge-config File name of a a JSON export of __fbBatchedBridgeConfig. Used by Prepack. Ex. ./bridgeconfig.json--bundle-output File name where to store the resulting bundle, ex. /tmp/groups.bundle [required]--bundle-encoding Encoding the bundle should be written in (https://nodejs.org/api/buffer.html#buffer_buffer). [default: "utf8"]--sourcemap-output File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map--assets-dest Directory name where to store assets referenced in the bundle--verbose Enables logging [default: false]

编写批处理文件方便后续打包,内容如下:

@rem react-native 生成bundle@echo offecho 正在生成bundle,生成文件请复制到assets目录@react-native bundle --entry-file index.android.js --assets-dest ../app/src/main/res/ --platform android --dev false --bundle-output ../app/src/main/assets/index.android.bundlepause
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表