Skip to content

Commit 4c558d7

Browse files
brunolemosTimer
authored andcommitted
Enable TypeScript json module resolver (#5531)
* Enable TypeScript json module resolver * Update verifyTypeScriptSetup.js
1 parent 2cf5cca commit 4c558d7

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

Diff for: packages/react-scripts/config/react-app.d.ts

-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
// Do not edit this file. It's replaced every time you launch a toolbox action.
33
// If you need to add additional declarations, please do so in a new file.
44

5-
declare module '*.json' {
6-
const value: any;
7-
export default value;
8-
}
9-
105
declare module '*.bmp' {
116
const src: string;
127
export default src;

Diff for: packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ const compilerOptions = {
2929
allowSyntheticDefaultImports: { suggested: true },
3030
strict: { suggested: true },
3131

32-
// This values are required and cannot be changed by the user
32+
// These values are required and cannot be changed by the user
3333
module: { value: 'esnext', reason: 'for import() and import/export' },
3434
moduleResolution: { value: 'node', reason: 'to match webpack resolution' },
35+
resolveJsonModule: { value: true, reason: 'to match webpack loader' },
3536
isolatedModules: { value: true, reason: 'implementation limitation' },
3637
noEmit: { value: true },
3738
jsx: { value: 'preserve', reason: 'JSX is compiled by Babel' },

0 commit comments

Comments
 (0)