Add data attribute to WooCommerce script

I would like to add a data attribute to a script that is placed by the WooCommerce plugin. This is the script:

woocommerce/assets/js/select2/select2.min.js

Because Cookiebot is set to automatic for us, this script is not loaded if the Cookies are refused. This causes a problem with our checkout and can be solved if we ignore the script.

Is it possible to add this attribute to that script via a function?

data-cookieconsent="ignore"

That should solve it, but I don’t know if this can be done with a function or another way.