我有一个用create-react-app
1.5搭建的React项目,想要使用create-react-app
2.0的功能。
具体地,我想要使用这个:https://github.com/facebook/create-react-app/pull/3909
我有一个用create-react-app
1.5搭建的React项目,想要使用create-react-app
2.0的功能。
具体地,我想要使用这个:https://github.com/facebook/create-react-app/pull/3909
基本上,要升级一个create-react-app
项目,你只需要将react-scripts
模块更新到最新版本并使你的应用程序与react-scripts
中的任何破坏性更改兼容即可。
运行yarn upgrade --latest react-scripts
命令,重新构建你的应用程序,并且除了任何破坏性更改外,一切都应该正常工作。
npm
命令,请输入以下内容:npm i -s --save-exact react-scripts@desired_version
,其中 desired_version
是你想要更新到的版本号。请注意,不要更改原指令的含义。 - 1valdisreact-scripts
包而不升级 create-react-app
? npm update
可以吗? - tonix