in aws_lambda_builders/workflows/nodejs_npm/workflow.py [0:0]
def __init__(self, source_dir, artifacts_dir, scratch_dir, manifest_path, runtime=None, osutils=None, **kwargs):
super(NodejsNpmWorkflow, self).__init__(
source_dir, artifacts_dir, scratch_dir, manifest_path, runtime=runtime, **kwargs
)
if osutils is None:
osutils = OSUtils()
if not osutils.file_exists(manifest_path):
LOG.warning("package.json file not found. Continuing the build without dependencies.")
self.actions = [CopySourceAction(source_dir, artifacts_dir, excludes=self.EXCLUDED_FILES)]
return
subprocess_npm = SubprocessNpm(osutils)
manifest_config = self.get_manifest_config(osutils, manifest_path)
if manifest_config["bundler"] == "esbuild" and is_experimental_esbuild_scope(self.experimental_flags):
self.actions = self.actions_with_bundler(
source_dir, artifacts_dir, manifest_config, osutils, subprocess_npm
)
else:
self.actions = self.actions_without_bundler(
source_dir, artifacts_dir, scratch_dir, manifest_path, osutils, subprocess_npm
)