Skip to content

Commit 5141281

Browse files
author
徐远翔
committed
docs: README
1 parent b1c1de1 commit 5141281

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ _与 DOM 无关的[umi](https://umijs.org/)插件都是可以使用的,或者
9696

9797
_上文未列出的[umi 配置](https://umijs.org/config)`umi-preset-react-native` 不生效。RN 开发不同于 Web 开发,基本上无须在编译工具上做过多配置。_
9898

99+
[haul](https://github.com/callstack/haul)使用的 devServer 是[hapi](https://hapi.dev/),目前还不支持扩展额外的 hapi 插件(中间件)。
100+
101+
我已经向[haul](https://github.com/callstack/haul)提交了 PR,正在等待进展。
102+
99103
#### umi-preset-react-native 扩展配置
100104

101105
```javascript

packages/preset/src/plugins/generateFiles/react-native/runtime.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ export function render(clientRender: () => any, args: {hot?: boolean} = {}) {
1010
`;
1111

1212
export default (api: IApi) => {
13+
api.addRuntimePlugin(() => [join(api.paths.absTmpPath!, 'react-native', 'runtime.ts')]);
1314
api.onGenerateFiles(() => {
14-
// 用户配了 mountElementId 就不再启动 RN 应用
15-
if (api.config.mountElementId) return;
16-
api.addRuntimePlugin(() => [join(api.paths.absTmpPath!, 'react-native', 'runtime.ts')]);
1715
api.writeTmpFile({
1816
path: 'react-native/runtime.ts',
1917
content: api.utils.Mustache.render(runtimeTpl, {

0 commit comments

Comments
 (0)