'Typescript compiler looping when "resolveJsonModule": true,
My typescript project compiles just fine until I add "resolveJsonModule": true, to my tsconfig.json.
I need that flag because I pull the package name & version from package.json when I'm seeing up my logger.
tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "es2017",
"esModuleInterop": true,
"sourceMap": true,
"outDir": "./.build",
"baseUrl": "./",
"strict": true,
"forceConsistentCasingInFileNames": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"noFallthroughCasesInSwitch": true,
"noUnusedParameters": true,
"noUnusedLocals": true,
"noImplicitOverride": true,
"skipLibCheck": true,
"noImplicitReturns": true,
"resolveJsonModule": true,
"typeRoots": ["./types/", "./node_modules/@types/"]
},
"include": ["./**/*.ts"],
"exclude": [
"node_modules/**/*",
".serverless/**/*",
".webpack/**/*",
".build/**/*",
"_warmup/**/*",
".vscode/**/*",
"*.config.js",
"**/*.js"
]
}
This is the command in my package.json that is kicking off the build:
"start": "npx serverless offline --stage dev --aws-profile svinstech_dev --useChildProcesses"
Thanks ahead of time!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
