mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-28 09:25:42 +08:00
Refine how TypeScript env types are handled (#5593)
* Specify types in package * Do not remove types file on eject * Stop copying types into generated project * Reference react and react-dom * Reference node types * Install node types as well * Restore copying * Add Node to the list of installed types * Reference Jest types * Remove jest types from install * Remove jest from CRA install * Remove Jest reference and let user do this themselves * Stop copying types file * Add types key to package.json * Add appTypeDeclarations and create when missing * Rename declarations file * Add Jest back to install instructions * Minimize diff
This commit is contained in:
3
packages/react-scripts/config/paths.js
vendored
3
packages/react-scripts/config/paths.js
vendored
@@ -84,6 +84,7 @@ module.exports = {
|
||||
appPackageJson: resolveApp('package.json'),
|
||||
appSrc: resolveApp('src'),
|
||||
appTsConfig: resolveApp('tsconfig.json'),
|
||||
appTypeDeclarations: resolveApp('src/react-app-env.d.ts'),
|
||||
yarnLockFile: resolveApp('yarn.lock'),
|
||||
testsSetup: resolveModule(resolveApp, 'src/setupTests'),
|
||||
proxySetup: resolveApp('src/setupProxy.js'),
|
||||
@@ -106,6 +107,7 @@ module.exports = {
|
||||
appPackageJson: resolveApp('package.json'),
|
||||
appSrc: resolveApp('src'),
|
||||
appTsConfig: resolveApp('tsconfig.json'),
|
||||
appTypeDeclarations: resolveApp('src/react-app-env.d.ts'),
|
||||
yarnLockFile: resolveApp('yarn.lock'),
|
||||
testsSetup: resolveModule(resolveApp, 'src/setupTests'),
|
||||
proxySetup: resolveApp('src/setupProxy.js'),
|
||||
@@ -138,6 +140,7 @@ if (
|
||||
appPackageJson: resolveOwn('package.json'),
|
||||
appSrc: resolveOwn('template/src'),
|
||||
appTsConfig: resolveOwn('template/tsconfig.json'),
|
||||
appTypeDeclarations: resolveOwn('template/src/react-app-env.d.ts'),
|
||||
yarnLockFile: resolveOwn('template/yarn.lock'),
|
||||
testsSetup: resolveModule(resolveOwn, 'template/src/setupTests'),
|
||||
proxySetup: resolveOwn('template/src/setupProxy.js'),
|
||||
|
||||
Reference in New Issue
Block a user