The following regex matches both cases - minified and not - however I have only tested it for a couple of individual use cases
/(\s*<script type="module" crossorigin>\s*)\(function[\s\S]*?\}\)\(\);/
The removed segment is \(\)\{ after function - when not minified, the polyfill is a named function
The following regex matches both cases - minified and not - however I have only tested it for a couple of individual use cases
/(\s*<script type="module" crossorigin>\s*)\(function[\s\S]*?\}\)\(\);/The removed segment is
\(\)\{afterfunction- when not minified, the polyfill is a named function