richardtallent / vite-plugin-singlefile

Vite plugin for inlining JavaScript and CSS resources
MIT License
808 stars 53 forks source link

Doesn't work with minify: false #72

Closed rcoopr closed 1 year ago

rcoopr commented 1 year ago

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

richardtallent commented 1 year ago

Thanks, fixed in 0.13.5!