Create React App 5.0.0 现已发布,这是一个主要版本。Create React App 是由 Facebook 推出的脚手架,基本可以零配置搭建基于 webpack 的 React 开发环境,并内置了热更新等功能。
具体更新内容如下:
Highlights
从 4.0.x 迁移到 5.0.0
在任何尚未 ejected 的已创建项目中,运行:
npm install --save --save-exact react-scripts@5.0.0
或者
yarn add --exact react-scripts@5.0.0
NOTE:如果在升级后遇到错误,你可能需要删除 node_modules 文件夹并通过运行 npm install(或 yarn)重新安装你的依赖。
Breaking Change
reate-react-app
- #11322 使用 env var 检测 yarn 或 npm 作为包管理器
babel-preset-react-app, cra-template-typescript, cra-template, create-react-app, eslint-config-react-app, react-app-polyfill, react-dev-utils, react-error-overlay,react-scripts
eslint-config-react-app, react-error-overlay,react-scripts
- #10761 chore:迁移到 @babel/eslint-parser
react-scripts
- #11188 弃用 root level template.json keys
错误修复
完整内容可查看:https://github.com/facebook/create-react-app/releases/tag/v5.0.0