Skip to content

Commit a6ecc0e

Browse files
authored
chore(aws-cdk-lib): npmignore source map files in v2 (#20363)
Closes #20320. Our source maps do not work as expected when debugging on the downloaded `aws-cdk-lib` package. They are, however, useful when debugging locally. Since our goal is to reduce module size, this PR adds `*.map` to `.npmignore` so that the source maps are not packaged along with the rest of the files. From the results of `npm pack`: - Before this change, the unpacked tarball size was 175.3 MB. - After this change, the unpacked tarball size is 123.5 MB. ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/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/master/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*
1 parent 12c8f02 commit a6ecc0e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Diff for: packages/aws-cdk-lib/.npmignore

+3
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ tsconfig.json
2727
junit.xml
2828

2929
!*.lit.ts
30+
31+
# exclude source maps as they only work locally
32+
*.map

Diff for: packages/aws-cdk-lib/scripts/minify-sources.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,12 @@
1616
scriptdir=$(cd $(dirname $0) && pwd)
1717
cd ${scriptdir}/..
1818

19-
find . -name '*.js' ! -name '.eslintrc.js' ! -path '*node_modules*' | xargs npx esbuild --sourcemap --platform=node --format=cjs --minify-whitespace --minify-syntax --tsconfig=tsconfig.json --allow-overwrite --outdir=.
19+
find . -name '*.js' ! -name '.eslintrc.js' ! -path '*node_modules*' | xargs npx esbuild \
20+
--sourcemap \
21+
--platform=node \
22+
--format=cjs \
23+
--minify-whitespace \
24+
--minify-syntax \
25+
--tsconfig=tsconfig.json \
26+
--allow-overwrite \
27+
--outdir=.

0 commit comments

Comments
 (0)