I can’t get my
preinstall lifecycle hook to run during netlify’s build. It runs fine locally when I do a
yarn install, but does not run in the netlify build environment.
Here’s a minimal test case reproduction: I added this commit to a barebones test-repo: test preinstall · jaredh159/monorepo-test@516a7b0 · GitHub
hello package just deploys a static
index.html file from
packages/hello/build/index.html. The preinstall script I wrote adds a line to the end of the file. And I modified the
build command so that it
cats out the file, as a test of whether it’s working on Netlify. (Also the deployed site would have the added line, but cat-ing it out allows it to be seen in the deploy logs as well).
Here’s the deploy log: Netlify App
And the published site, not showing the
PREINSTALL text: https://monorepo-test.netlify.app/