Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,7 @@ def run(self, args, cwd=None):
]

# Multi-value types (--external:axios --external:aws-sdk)
SUPPORTED_ESBUILD_APIS_MULTI_VALUE = [
"external",
"loader",
"out_extension",
]
SUPPORTED_ESBUILD_APIS_MULTI_VALUE = ["external", "loader", "out_extension", "banner"]


class EsbuildCommandBuilder:
Expand Down
10 changes: 9 additions & 1 deletion tests/unit/workflows/nodejs_npm_esbuild/test_esbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,14 @@ def test_builds_args_from_config(self, osutils_mock):

@patch("aws_lambda_builders.workflows.nodejs_npm.utils.OSUtils")
def test_combined_builder_with_dependencies(self, osutils_mock):
bundler_config = {"entry_points": ["x.js"], "loader": [".proto=text", ".json=js"], "format": "esm"}
bundler_config = {
"entry_points": ["x.js"],
"loader": [".proto=text", ".json=js"],
"format": "esm",
"banner": [
"js=\"import { createRequire } from 'module'; const require = createRequire(import.meta.url);\""
],
}
args = (
EsbuildCommandBuilder("scratch", "artifacts", bundler_config, osutils_mock, "")
.build_entry_points()
Expand All @@ -246,6 +253,7 @@ def test_combined_builder_with_dependencies(self, osutils_mock):
"--format=esm",
"--loader:.proto=text",
"--loader:.json=js",
"--banner:js=\"import { createRequire } from 'module'; const require = createRequire(import.meta.url);\"",
],
)

Expand Down