Skip to content

Commit

Permalink
fix(lambda-nodejs):false compiler options are not passed tsc (#21377)
Browse files Browse the repository at this point in the history
Any option that is set to false is omitted from the `tsc` command line options. This results in failed compilations during cdk synthesis whereas building directly with `tsc` does not fail.

closes #20670

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
hassanazharkhan authored Aug 4, 2022
1 parent 1000abe commit cef98cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-lambda-nodejs/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ export function getTsconfigCompilerOptions(tsconfigPath: string): string {
if (type === 'boolean') {
if (value) {
compilerOptionsString += option + ' ';
} else {
compilerOptionsString += option + ' false ';
}
} else if (type === 'string') {
compilerOptionsString += option + ' ' + value + ' ';
Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-lambda-nodejs/test/util.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ describe('getTsconfigCompilerOptions', () => {
'--alwaysStrict',
'--charset utf8',
'--declaration',
'--declarationMap false',
'--experimentalDecorators',
'--incremental false',
'--inlineSourceMap',
'--inlineSources',
'--lib es2020',
Expand All @@ -207,6 +209,7 @@ describe('getTsconfigCompilerOptions', () => {
'--strict',
'--strictNullChecks',
'--strictPropertyInitialization',
'--stripInternal false',
'--target ES2020',
].join(' '));
});
Expand Down

0 comments on commit cef98cf

Please sign in to comment.