如何将使用 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?
我有一个使用 create-react-app
1.5 构建的 React 项目。我想为我的 React 项目获得 create-react-app
2.0 的功能。
具体来说我想用这个:https://github.com/facebook/create-react-app/pull/3909
基本上,要升级 create-react-app
项目,all you need to do is update the react-scripts
module to the latest version 并更新您的应用以与 react-scripts
中的任何重大更改兼容。
运行 yarn upgrade --latest react-scripts
,重新构建您的应用程序,一切都应该或多或少地工作,除非有任何重大更改。
我有一个使用 create-react-app
1.5 构建的 React 项目。我想为我的 React 项目获得 create-react-app
2.0 的功能。
具体来说我想用这个:https://github.com/facebook/create-react-app/pull/3909
基本上,要升级 create-react-app
项目,all you need to do is update the react-scripts
module to the latest version 并更新您的应用以与 react-scripts
中的任何重大更改兼容。
运行 yarn upgrade --latest react-scripts
,重新构建您的应用程序,一切都应该或多或少地工作,除非有任何重大更改。