<script>
tags require specific ordering of attributes or else become type="module-shim"
#555
Closed
1 of 5 tasks
Milestone
Type of Change
Summary
Noticed as part of #554 that if you didn't organize the attributes of your
<script>
tag a specific way, your script tag would come out with the wrong type in production.For example, this works
will come out as
type="module-shim"
in production builds (and so of course won't load / work)Details
This is because in plugin-standard-thml, the regex expects a pattern like this:
/<script type="module-shim"/
Which mean it will only handle
<script>
tags of thetype
attribute comes first. Matching it to the pattern in plugin-node-modules would fix it./type="module-shim"/
One thought is to scope this kind of change to only what is in the
<head>
tag, to avoid clobbering a user's content.The text was updated successfully, but these errors were encountered: