I'm trying to run code for a Lambda function written in Typescript via SAM under the VS Code debugger, which has AWS Toolkit installed. The code does build and deploy successfully to the cloud, but running it under the debugger fails with error described in this question.
My build specifies esModuleInterop: true in tsconfig.json, and the SAM build ignores it, building instead as if esModuleInterop: false. It appears to use an arbitrary tsconfig.json given below, instead of the one in the project directory. How can I get it to use my tsconfig.json, or at least pass specific compiler options to tsc?
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"typeRoots": [
"node_modules/@types"
],
"types": [
"node"
],
"rootDir": ".",
"inlineSourceMap": true
}