This pull request updates the pnpm_prune_devdependencies function in the Heroku buildpack to support monorepos and prune dev dependencies in subfolders as necessary. The updated function checks for the presence of a pnpm-workspace.yaml file or a workspaces field in the root package.json file to determine if the project is a monorepo. If it is a monorepo, the function iterates through all subfolders (depth=2) containing a package.json file and prunes their dev dependencies using the pnpm prune --prod command.
Changes in this PR include:
Update the pnpm_prune_devdependencies function to check for a monorepo configuration.
If a monorepo is detected, find all subfolders containing a package.json file and prune their dev dependencies.
Preserve the existing behavior for non-monorepo projects.
This enhancement allows developers to optimize slug size for monorepo projects by removing unnecessary dev dependencies from subfolders, resulting (hopefully) in faster deployment times and improved performance on Heroku.
This pull request updates the pnpm_prune_devdependencies function in the Heroku buildpack to support monorepos and prune dev dependencies in subfolders as necessary. The updated function checks for the presence of a pnpm-workspace.yaml file or a workspaces field in the root package.json file to determine if the project is a monorepo. If it is a monorepo, the function iterates through all subfolders (depth=2) containing a package.json file and prunes their dev dependencies using the pnpm prune --prod command.
Changes in this PR include:
This enhancement allows developers to optimize slug size for monorepo projects by removing unnecessary dev dependencies from subfolders, resulting (hopefully) in faster deployment times and improved performance on Heroku.