aws-samples / aws-samples/lambda-nodejs-esbuild

Including node_modules in the minification

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
27
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Hello. Thanks for sharing this sample project.
I came from this [article](https://aws.amazon.com/blogs/compute/optimizing-node-js-dependencies-in-aws-lambda/) and need to use my code for a Lambda@Edge (`viewer-request`), limited to 1MB size.
When I try to run the build command, I got these issue:

```
✘ [ERROR] Could not resolve "./src//node_modules"

✘ [ERROR] No loader is configured for ".lock" files: src//yarn.lock
```

If you can help out, I would really appreciate it!

Contributor guide

Open the contributing guide

Research direction

Reproduce the build command using the layout shown in the errors, especially src//node_modules and yarn.lock. Determine why those paths are included in minification, then verify that the resulting Lambda@Edge viewer-request bundle excludes unnecessary files and remains under the 1 MB limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript, node.js
Domain
build-system, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.