-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yarn --ignore-scripts
causing issues
#634
Comments
This is needed because yarn does not provide a "prune" equivalent command. If someone were to kick off their build in https://yarnpkg.com/lang/en/docs/cli/prune/ I'm hesitant to add another script to support a niche workflow like this. Would adding an option to skip the prune step and letting you control this in a Hand-wavy:
|
Hi @OliverJAsh, were you able to resolve this and use the patch-package module? |
I think we just resolved to keep dev dependencies (i.e. disable pruning).
Yeah I think so! |
This should already be possible via |
@OliverJAsh Sorry for the delay here. Yes, the buildpack will skip pruning with Would adding a custom Heroku script at the end of the build be helpful? I think something like a |
That would be helpful. Another workaround I just thought it would be to run the cleanup in the |
@OliverJAsh We've added a |
Hi @OliverJAsh, just pinging again. I'd like to close this issue and want to make sure the solution we've provided fits the use case. |
Hi, sorry for missing your message. This is no longer a problem for us since we had to disable pruning of dev dependencies for other reasons, so I can't say whether it helps in our case, but maybe someone else who has faced this issue can help you? |
No problem - thanks for sharing. Going to go ahead and close this issue then. |
Just stumbled on this issue, and I can confirm that the new build steps work great. In the context of
This properly patches both locally and on Heroku for me. |
At Unsplash we use the popular tool
patch-package
to apply patches to our Node modules after installation. This works in the form of apostinstall
script.However, this buildpack invokes
yarn
with the--ignore-scripts
flag when pruning dev dependencies (since v119), which meanspatch-package
will not run.I can semi-understand why the buildpack would want to avoid invoking scripts, since the scripts were already run when
yarn
was invoked the first time, prior to building.However, in this case we rely on scripts being invoked each time
yarn
is called, as they significantly modify the contents ofnode_modules
. These modifications are needed for the app to run.It feels like we need an option to opt-in to running scripts after pruning? Perhaps
YARN_PRUNE_SCRIPTS
🤷♂️The text was updated successfully, but these errors were encountered: