Consider using '--resolveJsonModule code example

Example 1: Cannot find module './data.json'. Consider using '--resolveJsonModule' to import module with '.json' extension

add to tsconfig.json

{
	...
    "resolveJsonModule": true
  }
}

Example 2: Consider using '--resolveJsonModule

add "resolveJsonModule": true key in tsconfig.json

{
  "compilerOptions": {
    "target": "es2015",
    "module": "commonjs",
    "strict": true,
    "moduleResolution": "node",
    "resolveJsonModule": true
  }
}

Example 3: --resolveJsonModule

declare module "*.json" {
  const value: any;
  export default value;
}

Tags:

Misc Example