You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(cli): only load sourcemap when --debug flag is enabled (#23752)
Loading the sourcemap file is prohibitively slow.
We don't need to do this unless we actually want to debug things.
```console
# with inline sourcemap
$ time cdk --help
cdk --help 6.32s user 1.66s system 106% cpu 7.510 total
# with linked sourcemap
$ time cdk --help
./bin/cdk --help 4.01s user 0.38s system 113% cpu 3.872 total
# without sourcemap
$ time cdk --help
./bin/cdk --help 0.65s user 0.12s system 91% cpu 0.839 total
```
Sourcemap support can be tested by running an unknown command:
```console
$ cdk unknown -v
[12:05:46] Error: Unknown command: unknown
at main (/abc/node_modules/aws-cdk/lib/cli.ts:628:15)
at exec4 (/abc/node_modules/aws-cdk/lib/cli.ts:384:18)
```
----
### All Submissions:
* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)
### Adding new Construct Runtime Dependencies:
* [ ] This PR adds new construct runtime dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-construct-runtime-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*
0 commit comments