Skip to content

Commit 63704ed

Browse files
Timernate770
authored andcommitted
Turn on certain TypeScript options (facebook#5607)
1 parent 83154cb commit 63704ed

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,14 @@ module.exports = {
418418
async: false,
419419
checkSyntacticErrors: true,
420420
tsconfig: paths.appTsConfig,
421+
compilerOptions: {
422+
module: 'esnext',
423+
moduleResolution: 'node',
424+
resolveJsonModule: true,
425+
isolatedModules: true,
426+
noEmit: true,
427+
jsx: 'preserve',
428+
},
421429
watch: paths.appSrc,
422430
silent: true,
423431
formatter: typescriptFormatter,

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,14 @@ module.exports = {
538538
async: false,
539539
checkSyntacticErrors: true,
540540
tsconfig: paths.appTsConfig,
541+
compilerOptions: {
542+
module: 'esnext',
543+
moduleResolution: 'node',
544+
resolveJsonModule: true,
545+
isolatedModules: true,
546+
noEmit: true,
547+
jsx: 'preserve',
548+
},
541549
watch: paths.appSrc,
542550
silent: true,
543551
formatter: typescriptFormatter,

packages/react-scripts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"eslint-plugin-jsx-a11y": "6.1.2",
4646
"eslint-plugin-react": "7.11.1",
4747
"file-loader": "2.0.0",
48-
"fork-ts-checker-webpack-plugin-alt": "0.4.10",
48+
"fork-ts-checker-webpack-plugin-alt": "0.4.14",
4949
"fs-extra": "7.0.0",
5050
"html-webpack-plugin": "4.0.0-alpha.2",
5151
"identity-obj-proxy": "3.0.0",

packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ function verifyTypeScriptSetup() {
101101
forceConsistentCasingInFileNames: { suggested: true },
102102

103103
// These values are required and cannot be changed by the user
104+
// Keep this in sync with the webpack config
104105
module: {
105106
parsedValue: ts.ModuleKind.ESNext,
106107
value: 'esnext',

0 commit comments

Comments
 (0)