Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(aws-lambda-nodejs): Expose optional settings of logging and preserve name of function and classes while bundling #12046

Closed
1 task
hassanazharkhan opened this issue Dec 13, 2020 · 3 comments · Fixed by #12063
Assignees
Labels
@aws-cdk/aws-lambda-nodejs feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.

Comments

@hassanazharkhan
Copy link
Contributor

hassanazharkhan commented Dec 13, 2020

This feature request is to add bundling props while bundling from local or docker build from esbuild, there are lots of features that needs to be exposed from aws-lambda-nodejs

Use Case

There are cases where bundler prints warnings and errors in the terminal but most of the time these warnings are just warning and ignorable, so with the current implementation of bundler props we don't have any exposed settings to change the log level of the bundler.

Along with the above, there are no options to preserve the name of function and classes while bundling this is really useful where the name function or class used somewhere in the code dynamically.

I am also thinking to add a property that will be used to identify tsconfig if one doesn't want to use default tsconfig that property will tell the esbuild to use a particular config, i.e bundler.tsconfig.json. there are valid use cases of this.

Proposed Solution

const props: NodejsFunctionProps = {
             entry: `index.ts`,
             bundling: {
                 minify: false,
                 sourceMap: true,
                 logLevel: LogLevel.ERROR,
                 keepNames: true
             },
         }

Other

  • 👋 I can implement this feature request, it won't be difficult

This is a 🚀 Feature Request

@hassanazharkhan hassanazharkhan added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Dec 13, 2020
jogold added a commit to jogold/aws-cdk that referenced this issue Dec 14, 2020
@mergify mergify bot closed this as completed in #12063 Dec 15, 2020
mergify bot pushed a commit that referenced this issue Dec 15, 2020
Expose [`logLevel`](https://esbuild.github.io/api/#log-level) and [`keepNames`](https://esbuild.github.io/api/#keep-names).

Closes #12046


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@hassanazharkhan
Copy link
Contributor Author

@jogold When this will be available?

@jogold
Copy link
Contributor

jogold commented Dec 17, 2020

@jogold When this will be available?

In the next release

flochaz pushed a commit to flochaz/aws-cdk that referenced this issue Jan 5, 2021
Expose [`logLevel`](https://esbuild.github.io/api/#log-level) and [`keepNames`](https://esbuild.github.io/api/#keep-names).

Closes aws#12046


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda-nodejs feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants