Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何构建Taro 3.2.10版本并去掉RN相关的依赖 #9477

Closed
JNUfeatherwit opened this issue Jun 8, 2021 · 11 comments · Fixed by #9484
Closed

如何构建Taro 3.2.10版本并去掉RN相关的依赖 #9477

JNUfeatherwit opened this issue Jun 8, 2021 · 11 comments · Fixed by #9484
Labels
enhancement New feature or request

Comments

@JNUfeatherwit
Copy link

JNUfeatherwit commented Jun 8, 2021

这个特性解决了什么问题?

团队项目只用于小程序,对React Native没有需求,所以不需要任何对React Native的支持,目前发现Taro 3.2.10内置了大量React Native相关依赖,同时使用yarn时最后还会调用npm run patch-package命令,这个命令一直是失败的

这个 API 长什么样?

开发者可自主决定需不需要引入React Native相关依赖

@taro-bot2 taro-bot2 bot added the enhancement New feature or request label Jun 8, 2021
@JNUfeatherwit JNUfeatherwit changed the title 如何构建Taro 3.2.10版本同时去掉RN相关的依赖 如何构建Taro 3.2.10版本并去掉RN相关的依赖 Jun 8, 2021
@huarse
Copy link

huarse commented Jun 8, 2021

楼上 + 1,最近安装 babel-preset-taro 一直失败,都是挂在 npm run patch-package

@tourze
Copy link
Contributor

tourze commented Jun 8, 2021

"@tarojs/components-rn": "3.2.10",
"@tarojs/rn-runner": "3.2.10",
"@tarojs/rn-style-transformer": "3.2.10",
"@tarojs/rn-supporter": "3.2.10",
"@tarojs/runtime-rn": "3.2.10",
"@tarojs/taro-rn": "3.2.10",

这几个依赖去掉就好了吧

@Duo-Huang
Copy link

楼主解决了吗,我也遇到了patch-package 这个包压根装不上

@JNUfeatherwit
Copy link
Author

楼主解决了吗,我也遇到了patch-package 这个包压根装不上

在项目的package.json加上"patch-package": "^6.2.2"就可以了

@JNUfeatherwit
Copy link
Author

"@tarojs/components-rn": "3.2.10",
"@tarojs/rn-runner": "3.2.10",
"@tarojs/rn-style-transformer": "3.2.10",
"@tarojs/rn-supporter": "3.2.10",
"@tarojs/runtime-rn": "3.2.10",
"@tarojs/taro-rn": "3.2.10",

这几个依赖去掉就好了吧

去掉需要改源码

@Duo-Huang
Copy link

Duo-Huang commented Jun 8, 2021

我知道在项目的package.json上加patch-package依赖就可以了,但是这样让别人很费解,这个并不是我项目的直接依赖, 问题是这个包没有被安装上,是怎么触发的postinstall钩子的

@Duo-Huang
Copy link

image

@zhiqingchen
Copy link
Member

zhiqingchen commented Jun 8, 2021

已复现,可先按如上方案解决,近期会修复。

@zhiqingchen zhiqingchen linked a pull request Jun 8, 2021 that will close this issue
17 tasks
@zhiqingchen
Copy link
Member

另外也可在项目的package.json中加入版本锁定解决

  "resolutions": {
    "@ant-design/icons-react-native": "2.2.1"
  }

@zhiqingchen
Copy link
Member

@ant-design/icons-react-native 已更新到了 2.3.1,解决了上述报错。

@Duo-Huang
Copy link

@ant-design/icons-react-native

试了下这个版本好了,棒

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants