Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Commit 5d8776c

Browse files
committed
Allow using different tsconfig files for dev and build
1 parent e17362e commit 5d8776c

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

packages/react-scripts/config/paths.js

+3
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ module.exports = {
5959
testsSetup: resolveApp('src/setupTests.ts'),
6060
appNodeModules: resolveApp('node_modules'),
6161
appTsConfig: resolveApp('tsconfig.json'),
62+
appTsProdConfig: resolveApp('tsconfig.prod.json'),
6263
appTsLint: resolveApp('tslint.json'),
6364
publicUrl: getPublicUrl(resolveApp('package.json')),
6465
servedPath: getServedPath(resolveApp('package.json')),
@@ -81,6 +82,7 @@ module.exports = {
8182
testsSetup: resolveApp('src/setupTests.ts'),
8283
appNodeModules: resolveApp('node_modules'),
8384
appTsConfig: resolveApp('tsconfig.json'),
85+
appTsProdConfig: resolveApp('tsconfig.prod.json'),
8486
appTsTestConfig: resolveApp('tsconfig.test.json'),
8587
appTsLint: resolveApp('tslint.json'),
8688
publicUrl: getPublicUrl(resolveApp('package.json')),
@@ -113,6 +115,7 @@ if (
113115
testsSetup: resolveOwn('template/src/setupTests.ts'),
114116
appNodeModules: resolveOwn('node_modules'),
115117
appTsConfig: resolveOwn('template/tsconfig.json'),
118+
appTsProdConfig: resolveOwn('template/tsconfig.prod.json'),
116119
appTsLint: resolveOwn('template/tslint.json'),
117120
appTsTestConfig: resolveOwn('template/tsconfig.test.json'),
118121
publicUrl: getPublicUrl(resolveOwn('package.json')),

packages/react-scripts/config/webpack.config.prod.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ module.exports = {
183183
options: {
184184
// disable type checker - we will use it in fork plugin
185185
transpileOnly: true,
186+
configFile: paths.appTsProdConfig
186187
},
187188
},
188189
],
@@ -381,7 +382,7 @@ module.exports = {
381382
// Perform type checking and linting in a separate process to speed up compilation
382383
new ForkTsCheckerWebpackPlugin({
383384
async: false,
384-
tsconfig: paths.appTsConfig,
385+
tsconfig: paths.appTsProdConfig,
385386
tslint: paths.appTsLint,
386387
}),
387388
],
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./tsconfig.json"
3+
}

0 commit comments

Comments
 (0)