advanced-astro / min

Extremely ⚡ Fast and Smart HTML 🟠 JS 🟡 CSS 🔵 SVG 🟣 Minification
https://npm.im/astro-min
ISC License
36 stars 1 forks source link

Removes scripts setting up custom elements #9

Open gorbak25 opened 3 weeks ago

gorbak25 commented 3 weeks ago

When minifying this component

---
---
<astro-test> </astro-test>
<script>
    class AstroTest extends HTMLElement {
        constructor() {
            super();
            alert("This should fire");
        }
    }
    customElements.define("astro-test", AstroTest)
</script>

This minifier removes the entire script from the final output. This example works fine in dev builds.