Skip to content

Commit

Permalink
Merge pull request facebook#115 from nicolaserny/master
Browse files Browse the repository at this point in the history
Update tsconfig to support dynamic import
  • Loading branch information
wmonk authored Jul 27, 2017
2 parents 89cedc5 + 0880881 commit a445a40
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/react-scripts/config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion packages/react-scripts/scripts/utils/createJestConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module.exports = (resolve, rootDir) => {
},
globals: {
'ts-jest': {
tsConfigFile: paths.appTsConfig,
tsConfigFile: paths.appTsTestConfig,
},
},
};
Expand Down
2 changes: 1 addition & 1 deletion packages/react-scripts/template/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"outDir": "build/dist",
"module": "commonjs",
"module": "esnext",
"target": "es5",
"lib": ["es6", "dom"],
"sourceMap": true,
Expand Down
6 changes: 6 additions & 0 deletions packages/react-scripts/template/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs"
}
}

0 comments on commit a445a40

Please sign in to comment.