diff --git a/packages/react-scripts/config/paths.js b/packages/react-scripts/config/paths.js index b52ea6b82..c680d87b9 100644 --- a/packages/react-scripts/config/paths.js +++ b/packages/react-scripts/config/paths.js @@ -82,6 +82,7 @@ module.exports = { testsSetup: resolveApp('src/setupTests.ts'), appNodeModules: resolveApp('node_modules'), appTsConfig: resolveApp('tsconfig.json'), + appTsTestConfig: resolveApp('tsconfig.test.json'), publicUrl: getPublicUrl(resolveApp('package.json')), servedPath: getServedPath(resolveApp('package.json')), // These properties only exist before ejecting: @@ -112,6 +113,7 @@ if ( testsSetup: resolveOwn('template/src/setupTests.ts'), appNodeModules: resolveOwn('node_modules'), appTsConfig: resolveOwn('template/tsconfig.json'), + appTsTestConfig: resolveOwn('template/tsconfig.test.json'), publicUrl: getPublicUrl(resolveOwn('package.json')), servedPath: getServedPath(resolveOwn('package.json')), // These properties only exist before ejecting: diff --git a/packages/react-scripts/scripts/utils/createJestConfig.js b/packages/react-scripts/scripts/utils/createJestConfig.js index 9063be329..019767d7e 100644 --- a/packages/react-scripts/scripts/utils/createJestConfig.js +++ b/packages/react-scripts/scripts/utils/createJestConfig.js @@ -47,7 +47,7 @@ module.exports = (resolve, rootDir) => { }, globals: { 'ts-jest': { - tsConfigFile: paths.appTsConfig, + tsConfigFile: paths.appTsTestConfig, }, }, }; diff --git a/packages/react-scripts/template/tsconfig.json b/packages/react-scripts/template/tsconfig.json index d4627d98a..da796482d 100644 --- a/packages/react-scripts/template/tsconfig.json +++ b/packages/react-scripts/template/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "outDir": "build/dist", - "module": "commonjs", + "module": "esnext", "target": "es5", "lib": ["es6", "dom"], "sourceMap": true, diff --git a/packages/react-scripts/template/tsconfig.test.json b/packages/react-scripts/template/tsconfig.test.json new file mode 100644 index 000000000..65ffdd493 --- /dev/null +++ b/packages/react-scripts/template/tsconfig.test.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs" + } +} \ No newline at end of file
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: