I'm working on an Astro project and noticed something unexpected regarding <script> tags used with is:inline and define:vars.
When I define a script like this in an .astro component:
Code snippet
<script id="myCustomId" define:vars={{ myVar }} is:inline>
console.log(myVar);
</script>
...the id="myCustomId" attribute does not appear in the final rendered HTML when I 'View Page Source' in the browser. The define:vars part works correctly, and the script content is inlined as expected, but the id is stripped.
Is this the intended behavior for inline scripts with define:vars in Astro? If so, could you explain the rationale behind it? Are there specific types of attributes that Astro preserves or removes from inlined scripts during the build process?