Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { mult } from '@integ-handlers/util';

export async function handler(): Promise<void> {
console.log(mult(3, 4)); // eslint-disable-line no-console
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ class TestStack extends Stack {
},
runtime: STANDARD_NODEJS_RUNTIME,
});

new lambda.NodejsFunction(this, 'ts-paths-handler-tsconfig', {
entry: path.join(__dirname, 'integ-handlers/ts-paths-handler.ts'),
bundling: {
minify: true,
sourceMap: true,
sourceMapMode: lambda.SourceMapMode.BOTH,
tsconfig: path.join(__dirname, '..', 'tsconfig-custom.json'),
preCompilation: true,
},
runtime: STANDARD_NODEJS_RUNTIME,
});
}
}

Expand Down
2 changes: 2 additions & 0 deletions packages/aws-cdk-lib/aws-lambda-nodejs/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ export function getTsconfigCompilerOptions(tsconfigPath: string): string {
} else if (type === 'object') {
if (Array.isArray(value)) {
compilerOptionsString += option + ' ' + value.join(',') + ' ';
} else {
compilerOptionsString += option + ' \'' + JSON.stringify(value) + '\' ';
}
} else {
throw new Error(`Missing support for compilerOption: [${key}]: { ${type}, ${value}} \n`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"stripInternal": false,
"target": "ES2020",
"composite": true,
"tsBuildInfoFile": "tsconfig.tsbuildinfo"
"tsBuildInfoFile": "tsconfig.tsbuildinfo",
"paths": { "@test/paths": ["./test/paths"] }
}
}
2 changes: 2 additions & 0 deletions packages/aws-cdk-lib/aws-lambda-nodejs/test/util.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ describe('getTsconfigCompilerOptions', () => {
'--noUnusedLocals',
'--noUnusedParameters',
'--outDir ./',
'--paths \'{"@test/paths":["./test/paths"]}\'',
'--resolveJsonModule',
'--rootDir ./',
'--strict',
Expand Down Expand Up @@ -252,6 +253,7 @@ describe('getTsconfigCompilerOptions', () => {
'--noUnusedLocals',
'--noUnusedParameters',
'--outDir ./',
'--paths \'{"@test/paths":["./test/paths"]}\'',
'--resolveJsonModule',
'--rootDir ./',
'--strict',
Expand Down
Loading