Skip to content

Commit 8cd3fd4

Browse files
author
徐远翔
committed
fix: 将umi默认的临时文件目录由.umi修改为:tmp.
解决:[metro/issues/325](facebook/metro#325) 这个问题很诡异,直接使用React Native CLI时没问题;但换用expo确加载不到文件。
1 parent 440a200 commit 8cd3fd4

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ _上文未列出的[umi 配置](https://umijs.org/config)对 **umi-preset-react-
200200

201201
```text
202202
# umi-react-native
203-
.umi
203+
tmp
204204
index.js
205205
metro.config.js
206206
babel.config.js

packages/umi-preset-react-native/src/plugins/features/reactNative.ts

+9
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ export default (api: IApi) => {
2626
appKey = appJson.name;
2727
} catch (ignored) {}
2828

29+
/**
30+
* Metro Haste Module无法加载 Dot Folder: https://github.com/facebook/metro/issues/325
31+
*
32+
* 这个问题很诡异:
33+
* 使用 React Native CLI 时,可以加载成功;
34+
* 但 expo 中 的 metro 总是加载不到路径中包含"."的文件夹。
35+
*/
36+
api.modifyPaths((paths) => ({ ...paths, absTmpPath: join(absSrcPath, 'tmp') }));
37+
2938
// umi-preset-react-native 扩展配置
3039
api.describe({
3140
key: 'reactNative',

0 commit comments

Comments
 (0)