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:
    &quot;extra&quot;: {
         &quot;installer-paths&quot;: {
             &quot;public_html/core&quot;: [&quot;type:drupal-core&quot;],
             &quot;public_html/libraries/{$name}&quot;: [&quot;type:drupal-library&quot;],
             &quot;public_html/modules/contrib/{$name}&quot;: [&quot;type:drupal-module&quot;]
         },
         &quot;merge-plugin&quot;: {
             &quot;include&quot;: [
                 &quot;public_html/modules/contrib/webform/composer.libraries.json&quot;
             ]
         }
     }

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:
    &quot;repositories&quot;: {
        &quot;drupal&quot;: {
            &quot;type&quot;: &quot;composer&quot;,
            &quot;url&quot;: &quot;https://packages.drupal.org/8&quot;
        },
        &quot;jquery.inputmask&quot;: {
            &quot;type&quot;: &quot;package&quot;,
            &quot;package&quot;: {
                &quot;name&quot;: &quot;jquery/inputmask&quot;,
                &quot;version&quot;: &quot;5.0.6-beta.45&quot;,
                &quot;type&quot;: &quot;drupal-library&quot;,
                &quot;extra&quot;: {
                    &quot;installer-name&quot;: &quot;jquery.inputmask&quot;
                },
                &quot;dist&quot;: {
                    &quot;url&quot;: &quot;https://github.com/RobinHerbots/jquery.inputmask/archive/5.0.5.zip&quot;,
                    &quot;type&quot;: &quot;zip&quot;
                },
                &quot;require&quot;: {
                    &quot;composer/installers&quot;: &quot;~1.0&quot;
                }
            }
        }
    },

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.
But unsuccessful in that it does not have priority over the one defined in webform:

There is a way, just define custom repository before Drupal packages repository .
Change your composer.json to
   &quot;repositories&quot;: {
        &quot;jquery.inputmask&quot;: {
            &quot;type&quot;: &quot;package&quot;,
            &quot;package&quot;: {
                &quot;name&quot;: &quot;jquery/inputmask&quot;,
                &quot;version&quot;: &quot;5.0.6-beta.45&quot;,
                &quot;type&quot;: &quot;drupal-library&quot;,
                &quot;extra&quot;: {
                    &quot;installer-name&quot;: &quot;jquery.inputmask&quot;
                },
                &quot;dist&quot;: {
                    &quot;url&quot;: &quot;https://github.com/RobinHerbots/jquery.inputmask/archive/5.0.5.zip&quot;,
                    &quot;type&quot;: &quot;zip&quot;
                },
                &quot;require&quot;: {
                    &quot;composer/installers&quot;: &quot;~1.0&quot;
                }
            }
        },
       &quot;drupal&quot;: {
            &quot;type&quot;: &quot;composer&quot;,
            &quot;url&quot;: &quot;https://packages.drupal.org/8&quot;
        }
    },