New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update blank templates #3537
Update blank templates #3537
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/pikapkg/snowpack/HnM7pSWw2EivdWgsmJjEKbM47wNb |
@@ -6,6 +6,7 @@ | |||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |||
<meta name="description" content="Web site created using create-snowpack-app" /> | |||
<link rel="stylesheet" type="text/css" href="/dist/index.css" /> | |||
<script type="module" src="/dist/index.js" defer></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "defer" attribute can be removed since modules defer automatically. Per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#other_differences_between_modules_and_standard_scripts
There is no need to use the defer attribute when loading a module script; modules are deferred automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know, but @snowpack/plugin-webpack
removes type="module"
from the final build so defer
is still necessary here.
@@ -6,10 +6,10 @@ | |||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |||
<meta name="description" content="Web site created using create-snowpack-app" /> | |||
<link rel="stylesheet" type="text/css" href="/dist/index.css" /> | |||
<script type="module" src="/dist/index.js" defer></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As commented above, no need for "defer"
Changes
A fix and some other changes:
<img>
has been deleted fromblank-typescript
template<script>
elements have been moved to head anddefer
attributes have been added.Testing
Updated snapshots.
Docs
N/A, no user action required.