Updating to New Releases
In Create React App, there are two important packages:
- create-react-app: This is a global command-line utility used to create new React projects.
- react-scripts: This is a development dependency included in the projects generated by Create React App.
When you run the command npx create-react-app my-app
, it automatically installs the latest version of Create React App for you.
If you have previously installed create-react-app
globally using npm install -g create-react-app
, please refer to the Getting Started guide to learn about the current installation steps.
Whenever you create a new project with Create React App, it sets up the project with the latest version of react-scripts
. This ensures that you benefit from all the new features and improvements available in the latest version.
Updating react-scripts
in an Existing Projectβ
To update an existing project to a newer version of react-scripts
, you can follow these steps:
- Open the changelog for Create React App.
- Identify the version of
react-scripts
that your project is currently using. You can find this information in thepackage.json
file located in your project folder. - Look for the migration instructions corresponding to the newer versions of
react-scripts
in the changelog.
In most cases, simply updating the react-scripts
version in the package.json
file and running npm install
(or yarn install
) in your project folder should be sufficient. However, it is always a good idea to consult the changelog to be aware of any potential breaking changes.
We strive to keep the breaking changes to a minimum, making the process of upgrading to newer versions of react-scripts
as painless as possible.
Create React App does not automatically include polyfills for you. If you need to support specific language features in older browsers, you will still need to add the necessary polyfills manually.
If you make changes to the browserslist
configuration but notice that your changes are not being picked up immediately, it may be due to an issue in babel-loader that prevents the detection of changes in your package.json
. To resolve this, you can delete the node_modules/.cache
folder and try again.
Summaryβ
Keeping your project up to date with the latest version of react-scripts
is important to ensure that you benefit from the latest features and improvements. By following the migration instructions in the changelog, you can safely update your project to a newer version of react-scripts
and keep your project in sync with the latest developments in the React ecosystem.