reactnativecn / react-native-website

React Native 中文网
https://reactnative.cn
MIT License
216 stars 328 forks source link

使用 babel-plugin-module-resolver #590

Closed zhaozhuangwang closed 1 year ago

zhaozhuangwang commented 2 years ago

根据文档生成项目,TypeScript

npx react-native init MyApp --template react-native-template-typescript

yarn android

运行项目 正常访问,

想引入这个包 用 babel-plugin-module-resolver 文件夹相对地址

问题

按照文档 配置 https://reactnative.cn/docs/next/typescript babel.config.js tsconfig.json

yarn android 运行之后

期望是 通过 @xxx/ 使用文件夹相对地址

结果如下

image

package.json 如下

package.txt

tsconfig.json 如下

tsconfig.txt

想请问是哪里配置错了

sunnylqm commented 2 years ago

你的tsconfig里的compilerOptions都重复了

zhaozhuangwang commented 2 years ago

compilerOptions 。。。好的 大牛 非常感谢!

github-actions[bot] commented 1 year ago

👋 Hey there, it looks like there has been no activity on this issue in the last 90 days. Has the issue been fixed, or does it still require the community attention? This issue will be closed in the next 7 days if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 1 year ago

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.