Skip to content

Not possible to patch composer.json of a dependency #233

@claudiu-cristea

Description

@claudiu-cristea

My use case is that I want to apply a patch to a Drupal module composer.json. Specifically, I want to add an "autoload" section. But after running the mai project composer, I see that the module autoloading addition is not in effect.

My guess is that the packages are parsed before cweagans/composer-patches is acting. So, when the autoload files are generated, at the end of the process, is still using the initial package definitions. I didn't tests if this is true also when adding a new composer dependency via a patch.

I have no idea on the compose internals but isn't it possible to reread the package definitions after the patches were applied?

EDIT: Or do that only if a composer.json file has been patched?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions