How do you guys import json files? i have this in...
# typescript
p
How do you guys import json files? i have this in my ts file
Copy code
import serviceConfig from '../appsettings.json';
this in ts config
Copy code
{
    "compilerOptions": {
        "strict": true,
        "outDir": "bin",
        "target": "es2016",
        "module": "commonjs",
        "moduleResolution": "node",
        "sourceMap": true,
        "experimentalDecorators": true,
        "pretty": true,
        "noFallthroughCasesInSwitch": true,
        "noImplicitReturns": true,
        "forceConsistentCasingInFileNames": true,
        "resolveJsonModule": true,
    },
    "files": [
        "index.ts"
    ]
}
But iam till gettin this error Cannot find module '../appsettings.json'. Consider using '--resolveJsonModule' to import module with '.json' extension