build
build copied to clipboard
Move `npm install` and `yarn` logic from the buildbot to Netlify Build
Build plugins are installed using npm install or yarn.
We already install dependencies using npm install or yarn in the buildbot. The buildbot logic includes several features: caching, YARN_VERSION, NPM_VERSION, YARN_FLAGS, NPM_FLAGS. Due to having two separate logic, those are not supported when installing Build plugins. For example, NPM_FLAGS support for plugins installation was requested in #1175.
We should move the buildbot logic to Netlify Build instead. This is rather delicate operation since any difference of behavior would result in build failures.
Note: thanks to Netlify Build version pinning, we can now release a buildbot PR + Netlify Build PR together atomically, which should help.
@ehmicky, I have a request here. If we do this can there also please be a stage before the stage in the build cycle?
Customers have long been asking for a way to run code/commands before dependency install. If we do move dependency install into Netlify Build having a stage before this would solve a long-standing problem for our customers.
The mostly want to edit their dependencies manually (for example using sed or other tools to edit package.json) to prevent certain dependencies from being installed for the Netlify build.
Yes absolutely! We have discussed adding a onPreInstall event in Build plugins. This could run before npm install and yarn.
However until we move the other installations command for other languages/frameworks, this would still be run after those. So we could (should?) also wait after those have been moved to.
onPreInstall tracked separately at #1149.
This issue has been automatically marked as stale because it has not had activity in 1 year. It will be closed in 14 days if no further activity occurs. Thanks!
This issue was closed because it had no activity for over 1 year.