diff --git a/packages/react-scripts/config/webpack.config.dev.js b/packages/react-scripts/config/webpack.config.dev.js index 8a23af48a6e..e13a486778e 100644 --- a/packages/react-scripts/config/webpack.config.dev.js +++ b/packages/react-scripts/config/webpack.config.dev.js @@ -424,6 +424,14 @@ module.exports = { async: false, checkSyntacticErrors: true, tsconfig: paths.appTsConfig, + compilerOptions: { + module: 'esnext', + moduleResolution: 'node', + resolveJsonModule: true, + isolatedModules: true, + noEmit: true, + jsx: 'preserve', + }, watch: paths.appSrc, silent: true, formatter: typescriptFormatter, diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index 654fb3390a2..a2ec245e4da 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -544,6 +544,14 @@ module.exports = { async: false, checkSyntacticErrors: true, tsconfig: paths.appTsConfig, + compilerOptions: { + module: 'esnext', + moduleResolution: 'node', + resolveJsonModule: true, + isolatedModules: true, + noEmit: true, + jsx: 'preserve', + }, watch: paths.appSrc, silent: true, formatter: typescriptFormatter, diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 69c2ee4b5c4..d6cea812012 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -45,7 +45,7 @@ "eslint-plugin-jsx-a11y": "6.1.2", "eslint-plugin-react": "7.11.1", "file-loader": "2.0.0", - "fork-ts-checker-webpack-plugin-alt": "0.4.10", + "fork-ts-checker-webpack-plugin-alt": "0.4.14", "fs-extra": "7.0.0", "html-webpack-plugin": "4.0.0-alpha.2", "identity-obj-proxy": "3.0.0", diff --git a/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js b/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js index eb592deced0..0799b120b60 100644 --- a/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js +++ b/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js @@ -101,6 +101,7 @@ function verifyTypeScriptSetup() { forceConsistentCasingInFileNames: { suggested: true }, // These values are required and cannot be changed by the user + // Keep this in sync with the webpack config module: { parsedValue: ts.ModuleKind.ESNext, value: 'esnext',