From 90336e5f1c8b21f0b4e40f9b5d086bb6dac347ae Mon Sep 17 00:00:00 2001 From: Shruthi Rai Date: Mon, 10 Jan 2022 10:22:44 +0100 Subject: [PATCH] fix: Resolving json file import issue --- react-app/src/index.ts | 4 +++- react-app/tsconfig.json | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/react-app/src/index.ts b/react-app/src/index.ts index 9f02d4b1..043d253d 100644 --- a/react-app/src/index.ts +++ b/react-app/src/index.ts @@ -3,4 +3,6 @@ export { colorTableData, DiscreteColorLegend } from './component/Legend/Discrete export { colorsArray, rgbValues, RGBToHex} from './component/Utils/continousLegend'; export { colorTablesObj, colorTablesArray } from './component/ColorTableTypes'; export { propertiesObj, templateArray } from './component/WelllayerTemplateTypes'; -export const colorTables = require('./component/color-tables'); +//export const colorTables = require('./component/color-tables'); +import * as colorTables from './component/color-tables.json'; +export default colorTables; diff --git a/react-app/tsconfig.json b/react-app/tsconfig.json index 65b9694f..60842800 100644 --- a/react-app/tsconfig.json +++ b/react-app/tsconfig.json @@ -16,7 +16,9 @@ "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": true, "noUnusedParameters": true, - "resolveJsonModule": true + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true }, "include": ["src"], "exclude": ["node_modules"]