Skip to content

Yarn --ignore-scripts causing issues #634

@OliverJAsh

Description

@OliverJAsh

At Unsplash we use the popular tool patch-package to apply patches to our Node modules after installation. This works in the form of a postinstall script.

However, this buildpack invokes yarn with the --ignore-scripts flag when pruning dev dependencies (since v119), which means patch-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 of node_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 🤷‍♂️

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions