如何升级由create-react-app添加的依赖项

时间:2020-10-01 18:10:17

标签: create-react-app

我们何时以及如何升级create-react-app添加到package.json的依赖项?

今天我运行了npx create-react-app my-app --template typescript,它添加了以下依赖项:

  "dependencies": {
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.3.2",
    "@testing-library/user-event": "^7.1.2",
    "@types/jest": "^24.0.0",
    "@types/node": "^12.0.0",
    "@types/react": "^16.9.0",
    "@types/react-dom": "^16.9.0",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-scripts": "3.4.3",
    "typescript": "~3.7.2"
  }

即使某些版本有较新的版本:

  • “ @ testing-library / jest-dom”:“ ^ 5.11.4”
  • “ @ testing-library / react”:“ ^ 11.0.4”
  • “ @ testing-library / user-event”:“ ^ 12.1.6”
  • “打字稿”:“〜4.0.3”

我们可以随时升级任何依赖项,还是将它们绑定到react-scripts的特定版本?如果是后者,我们如何知道何时升级以及升级到哪个版本?

0 个答案:

没有答案