如何将使用create-react-app构建的React项目升级到下一个create-react-app版本? [英] How to upgrade a React project built with create-react-app to the next create-react-app version?

查看:779
本文介绍了如何将使用create-react-app构建的React项目升级到下一个create-react-app版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 create-react-app 1.5构建的React项目。我想为我的React项目获得 create-react-app 2.0的功能。

I have a React project built with create-react-app 1.5. I would like to get the features of create-react-app 2.0 for my React project.

我可以喜欢这样使用: https://github.com/facebook/create-react- app / pull / 3909

Specifically I would like to use this: https://github.com/facebook/create-react-app/pull/3909

推荐答案

基本上,要升级 create-react-app 项目,您需要做的就是将反应脚本模块更新到最新版本,并更新您的应用程序以使其兼容反应脚本的任何重大更改。

Basically, to upgrade a create-react-app project, all you need to do is update the react-scripts module to the latest version and update your app to be compatible with any breaking changes in react-scripts.

运行 纱线升级-最新的反应脚本 ,重新构建您的应用,一切都应该更多-或更少的工作,除非有任何重大更改。

Run yarn upgrade --latest react-scripts, rebuild your app, and everything should more-or-less work, barring any breaking changes.

这篇关于如何将使用create-react-app构建的React项目升级到下一个create-react-app版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆