Skip to content

Commit 5117f46

Browse files
authored
Chore/remove safari nomodule polyfill (#1574)
1 parent b3b6984 commit 5117f46

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.changeset/lazy-fireants-think.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'preact-cli': minor
3+
---
4+
5+
Removes Safari nomodule polyfill from template

packages/cli/lib/resources/body-end.ejs

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
</script>
66
<% } %>
77
<% if (webpack.assets.filter(entry => entry.name.match(/bundle(\.\w{5})?.esm.js$/)).length > 0) { %>
8-
<% /* Fix for safari < 11 nomodule bug. TODO: Do the following only for safari. */ %>
9-
<script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
108
<script crossorigin="anonymous" src="<%= htmlWebpackPlugin.files.publicPath %><%= webpack.assets.filter(entry => entry.name.match(/bundle(\.\w{5})?.esm.js$/))[0].name %>" type="module"></script>
119
<%
1210
/*Fetch and Promise polyfills are not needed for browsers that support type=module

0 commit comments

Comments
 (0)