8 – How to override version of drupal-library (JavaScript library) included with composer merge-plugin?

I’m using Webform with the composer-merge plugin to bring in its libraries:

Relevant parts of my composer.json file:

    "extra": {
         "installer-paths": {
             "public_html/core": ("type:drupal-core"),
             "public_html/libraries/{$name}": ("type:drupal-library"),
             "public_html/modules/contrib/{$name}": ("type:drupal-module")
         },
         "merge-plugin": {
             "include": (
                 "public_html/modules/contrib/webform/composer.libraries.json"
             )
         }
     }

I can define my own version of the same library successfully, by using the same code as Webform’s composer.libraries.json does but changing the version— successful in that it is recognized:

    "repositories": {
        "drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        "jquery.inputmask": {
            "type": "package",
            "package": {
                "name": "jquery/inputmask",
                "version": "5.0.6-beta.45",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "jquery.inputmask"
                },
                "dist": {
                    "url": "https://github.com/RobinHerbots/jquery.inputmask/archive/5.0.5.zip",
                    "type": "zip"
                },
                "require": {
                    "composer/installers": "~1.0"
                }
            }
        }
    },

But unsuccessful in that it does not have priority over the one defined in webform:

  • Root composer.json requires jquery/inputmask 5.0.6-beta.45, it is satisfiable by jquery/inputmask(5.0.6-beta.45) from package repo (defining 1 package) but jquery/inputmask(5.0.5) from package repo (defining 1 package) has higher repository priority. The packages with higher priority do not match your constraint and are therefore not installable. See https://getcomposer.org/repoprio for details and assistance.

But i don’t know how to take priority.