aws / aws/aws-toolkit-vscode

Can the outDir be changed for where the aws-toolkit-tsconfig.json generated Typescript output files go?

Open
#4,432 1 comment 0 reactions 0 assignees View on GitHub
cdk guidance lambda language:node language:typescript needs-response sam
Dominant language
TypeScript
Stars
2k
Forks
807
Avg merge
10h 12m
Merged PRs (30d)
7

Description

## System details (run the `AWS: About Toolkit` command)

- OS: Windows 11
- Visual Studio Code version: 1.86.1
- AWS Toolkit version: 2.9.0
- Typescript version: 5.3.3
- Sam CLI Version 1.108.0
- CDK Version: 2.117.0

## Question

Me and my team are using AWS CDK to define our infrastructure. I've installed SAM CLI and AWS Toolkit in order to locally debug lambda functions in VSCode per guidelines here:
https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/setup-toolkit.html
https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/serverless-apps-run-debug-no-template.html

I've pretty much gotten it working. But one thing I tried I could not get working, and that was changing the outDir location in the aws-toolkit-tsconfig.json to a subfolder in the project to prevent a bunch of *.js and *.d.ts files from being added to the project directory.

It would be preferred both from a git management perspective (easy to gitignore) and a cleanup perspective (easy to delete files in the subfolder after the testing is completed). However, if I modfy the outDir using the generated launch.json configuration, I get an error:

```bash
undefined ERROR Uncaught Exception {"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module
```

Any guidance on how to set this up properly would be greatly appreciated.

Contributor guide

Open the contributing guide

Research direction

Start with the generated aws-toolkit-tsconfig.json and the launch.json configuration described in the issue, then reproduce local Lambda debugging with a custom outDir. Trace how the generated output location relates to the lambda module path; done means compiled files are isolated in the requested subfolder and debugging completes without an ImportModuleError.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript, vscode
Domain
developer-experience, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.