5

In the recent update to Composer 2.0 the advice is to get rid of the wikimedia/composer-merge-plugin, which was even removed from the dependencies of Drupal core.

There is documentation on how to include custom module's composer.json in the root composer.json, for example Managing dependencies for a custom project, but I cannot find documentation on how to include composer.libraries.json in the root composer.json.

Can anyone explain how to get the Webform module compatible with Composer 2.0?

1

here is a specific way how to do it for webform module.

  1. run composer require wikimedia/composer-merge-plugin
  2. in composer add
  "merge-plugin": {
            "include": [
                "web/modules/contrib/webform/composer.libraries.json"
            ]
        },
  1. run composer update --lock and verify the files

Reference https://www.drupal.org/docs/8/modules/webform/webform-frequently-asked-questions/how-to-use-composer-to-install-libraries

Reference 2 https://www.drupal.org/docs/8/modules/webform/webform-cookbook/using-the-composer-merge-plugin-to-download-libraries-with

Github issue https://github.com/wikimedia/composer-merge-plugin/issues/184

3
  • 1
    The question seems to explicitly ask for how to not use the wikimedia/composer-merge-plugin. – leymannx Jan 3 at 22:45
  • Hi Ales, thank you for the response. Indeed, as Leymannx says the question is how to not use the wikimedia/composer-merge-plugin... So unfortunately your solution does not work. This is how it is implemented now, but not how it should be implemented according to composer 2.0. – Koen Strien Jan 4 at 9:30
  • As Ales referenced, there is a GitHub issue for Composer Merge Plugin to be compatible with Composer 2, which has been fixed and it now is, so maybe this is the best answer after all. – mlncn Apr 7 at 21:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.