-
Notifications
You must be signed in to change notification settings - Fork 399
Package Size Issue with Azure Login GitHub Action #366
Description
Description
I've identified a significant issue with the Azure login GitHub action, where the action's package size is excessively large. After unpacking, the node_modules directory alone is 118MB. This substantial size dramatically affects the startup time of the GitHub action. It seems all dependencies, including those not needed for production, are being installed in the package. Additionally, the package contains folders like tests, src, and .github, which are unnecessary for the action's operation.


Download Link
Proposed Solution:
-
Production-Optimized Configuration: Configure the package specifically for production use, adhering to npm standards. Exclude non-production dependencies and unnecessary folders like
__tests__,src, and.githubto reduce the package size and improve performance. -
Use of @vercel/ncc for Compiling Code: As an alternative to checking in the
node_modulesdirectory, which can cause issues, use the@vercel/ncctool to compile code and modules into a single file for distribution. This approach is suggested in GitHub's documentation. After installing@vercel/ncc, compile theindex.jsfile, resulting in a newdist/index.jsfile with code and compiled modules, alongside adist/licenses.txtfile containing all licenses of the usednode_modules. Update theaction.ymlfile to usedist/index.jsand remove the previously checked-innode_modulesdirectory. This solution ensures a more efficient and streamlined package, in line with best practices for GitHub actions.