aws / aws-toolkit-azure-devops

AWS Toolkit for Azure DevOps
Other
245 stars 104 forks source link

Mark shelljs as external for esbuild bundling #537

Closed rbbarad closed 8 months ago

rbbarad commented 9 months ago

Marks ShellJS as external for ESBuild Bundling. This fixes the issue in #522

Description

This issue emerged with the bump of azure-pipelines-task-lib dependency in: https://github.com/aws/aws-toolkit-azure-devops/pull/473.

Problem summarized in the open issue on azure-pipelines-task-lib repo: Cannot use JS bundler because of shelljs dependency.

Essentially, the toolkit takes a dependency on azure-pipelines-task-lib which takes an additional dependency on ShellJS. Our toolkit uses the esbuild JS Bundler to build the extension. This fails to bundle ShellJS because it uses dynamic require statements (problematic ShellJS code) instead of explicit require statements, which prevents bundlers from correctly analyzing the dependencies.

Related Issue(s), If Filed

Testing

Confirmed that tasks run locally (e.g. node ./package/Tasks/AWSCLI/AWSCLI.js) and on hosted agent

Checklist

License

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

bryceitoc9 commented 8 months ago

/retryBuilds