feat: reduce sourcemaps and visualize dep tree#1
feat: reduce sourcemaps and visualize dep tree#1rehanvdm wants to merge 1 commit intobruuuuuuuce:mainfrom
Conversation
bruuuuuuuce
left a comment
There was a problem hiding this comment.
@rehanvdm thanks for this pr, this looks great! I pulled it down and tested it locally and everything looks good from my end. Really appreciate the feedback and analysis! I left one comment about a dependency, but once that is resolved I can merge this. Thanks again!
| "aws-lambda": "^1.0.7", | ||
| "lambda-log": "^3.1.0" | ||
| "lambda-log": "^3.1.0", | ||
| "open": "^8.4.2" |
There was a problem hiding this comment.
I believe this should be a dev dependency
There was a problem hiding this comment.
It can be yes, I mainly opened it to show what is possible. From the blog article, it seemed that you don't want to ship the sourcemaps with? So my idea with this PR wasn't that it will get merged, just to show that it is possible. Else if merged you would have to change parts of the article?
If not and you do want to merge it, by all means :). Please feel free to make the small change above or I can as well.
Nice article btw :). Also FYI, I created two issues that will/might turn into PRs upstream on the CDK:
This PR adds two features
Includng reduces sourcemaps
Excluding sourcemaps and shipping them to your third-party provider is great, but for Lambdas using CloudWatch, you have to include them to get meaningful traces.
This PR shows how you can drastically reduce the source maps by excluding anything from
node_modules/shrinking the souremap file from 34K to 2.2K.Size Before
Size After
Visualize esbuild bundle
Similar to webpack, we can visualize our bundle, with a bit of work. It will open the bundle analysis as a HTML file after each build.
Example:
