in aws_lambda_builders/workflows/nodejs_npm_esbuild/actions.py [0:0]
def execute(self) -> None:
"""
Runs the action.
Raises
------
ActionFailedError
when esbuild packaging fails
"""
esbuild_command = EsbuildCommandBuilder(
self._working_directory, self._output_directory, self._bundler_config, self._osutils, self._manifest
)
if self._should_bundle_deps_externally():
check_minimum_esbuild_version(
minimum_version_required=MINIMUM_VERSION_FOR_EXTERNAL,
working_directory=self._working_directory,
subprocess_esbuild=self._subprocess_esbuild,
)
esbuild_command.build_with_no_dependencies()
if EXTERNAL_KEY in self._bundler_config:
# Already marking everything as external,
# shouldn't attempt to do it again when building args from config
self._bundler_config.pop(EXTERNAL_KEY)
args = (
esbuild_command.build_entry_points().build_default_values().build_esbuild_args_from_config().get_command()
)
try:
self._subprocess_esbuild.run(args, cwd=self._working_directory)
except EsbuildExecutionError as ex:
raise ActionFailedError(str(ex))