File tree 2 files changed +12
-4
lines changed
packages/umi-react-native-multibundle/ios
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1
1
# umi-react-native
2
2
3
- ![ ] ( https://img.shields.io/npm/dm/umi-preset-react-native?style=flat-square ) [ ![ PRs Welcome] ( https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square )] ( http://makeapullrequest.com )
3
+ ![ ] ( https://img.shields.io/npm/dm/umi-preset-react-native?style=flat-square ) [ ![ PRs Welcome] ( https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square )] ( http://makeapullrequest.com )
4
4
5
5
使用 [ umi@3.x ] ( https://umijs.org/ ) 加速 [ react-native] ( https://reactnative.dev/ ) 开发效率:
6
6
7
7
- ** 零配置** ,添加[ DvaJS] ( https://dvajs.com/ ) ,[ @ant-design/react-native ] ( https://rn.mobile.ant.design/index-cn ) ... 等依赖后开箱即用;
8
8
- 只需要专注页面 UI 和业务领域模型的实现,所有编译配置,框架运行所需 HOC 和 Context Provider 全部由 umi 搞定;
9
- - 路由方案默认使用 [ umi] ( https://umijs.org/ ) 内置的[ react-router] ( https://reacttraining.com/react-router/ ) ,** 可选** [ react-navigation] ( https://reactnavigation.org/ ) 。
9
+ - 路由方案默认使用 [ umi] ( https://umijs.org/ ) 内置的[ react-router] ( https://reacttraining.com/react-router/ ) ,** 可选** [ react-navigation] ( https://reactnavigation.org/ ) ;
10
+ - 启用[ dynamicImport] ( https://umijs.org/config#dynamicimport ) 配置后,支持切分多 bundle,运行时从应用本地按需加载 JS bundle 文件。
10
11
11
12
| NPM 包 | 当前版本 | 简介 |
12
13
| --- | --- | --- |
@@ -40,6 +41,14 @@ umi 在 RN 中仅用来生成中间代码(临时文件),介于**编码**
40
41
41
42
查看示例工程:[ UMIHaulExample] ( https://github.com/xuyuanxiang/UMIHaulExample#readme )
42
43
44
+ ### 切分多 bundle
45
+
46
+ 开发阶段使用:[ React Native CLI] ( https://github.com/react-native-community/cli/blob/master/docs/commands.md#commands ) ;
47
+
48
+ 构建离线包使用:[ haul] ( https://github.com/callstack/haul ) 拆包。
49
+
50
+ 查看示例工程:[ UMIHaulExample#feature/multibundle] ( https://github.com/xuyuanxiang/UMIHaulExample/tree/feature/multibundle )
51
+
43
52
## 文档
44
53
45
54
- [ 发布日志] ( /CHANGELOG.md )
Original file line number Diff line number Diff line change @@ -17,8 +17,7 @@ @implementation Multibundle
17
17
18
18
@try
19
19
{
20
- NSURL *url = [[NSBundle mainBundle ] URLForResource: bundleName withExtension: @" ios.bundle" ];
21
- [bridge registerSegmentWithId: [bundleId unsignedIntegerValue ] path: url.absoluteString];
20
+ [bridge registerSegmentWithId: [bundleId unsignedIntegerValue ] path: [[NSBundle mainBundle ] pathForResource: bundleName ofType: @" ios.bundle" ]];
22
21
23
22
resolve (nil );
24
23
You can’t perform that action at this time.
0 commit comments