-
Notifications
You must be signed in to change notification settings - Fork 4.4k
(aws-lambda-nodejs): support charset option #16668
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-lambda-nodejsfeature-requestA feature should be added or improved.A feature should be added or improved.needs-triageThis issue or PR still needs to be triaged.This issue or PR still needs to be triaged.
Description
Use Case
If we deploy a Lambda function that currently contains multibyte characters, the escaped characters will be output.
I am currently facing the same problem that the official documentation is talking about when using CDK.
esbuild API document says
using escape sequences makes the generated output slightly bigger, and also makes it harder to read.
Example
Input Lambda code
exports.handler = async (event) => { console.log("Japanese:日本語"); }Current output code
exports.handler = async (event) => {
console.log("Japanese:\u65E5\u672C\u8A9E");
};Expected output code
exports.handler = async (event) => {
console.log("Japanese:日本語");
};Proposed Solution
Add the charset option to the bundling.
new NodejsFunction(this, 'ExampleLambda', {
bundling: {
charset: 'utf-8',
},
...
});Other
Possible response methods
- Add the
charsetproperty toBundlingOptions. - Add a process to
createBundlingCommandto expand the charset property
- 👋 I may be able to implement this feature request
-
⚠️ This feature might incur a breaking change
This is a 🚀 Feature Request
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-lambda-nodejsfeature-requestA feature should be added or improved.A feature should be added or improved.needs-triageThis issue or PR still needs to be triaged.This issue or PR still needs to be triaged.