-
-
Notifications
You must be signed in to change notification settings - Fork 418
move %sapper.scripts% to <head> with defer #1123
Conversation
artemjackson
left a comment
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.
lgtm
|
AppVeyor build failed cuz of |
|
Sapper has now been updated to use GitHub actions. If you rebase this PR against |
|
Can we merge this PR? It should be a nice perf win. |
|
@iOiurson |
|
If this requires a corresponding change to a consumer's |
|
Adding the Also of note, this only affects Webpack users. The script is of type |
This PR moves
%sapper.scripts%to<head>withdeferattribute for the main script.Some parts of the inserted scripts are inlined, in particular when using Rollup as the bundler.
Inline scripts are not affected by
defer.But it seems in this case the inline scripts mainly import the main script dynamically, thus it should be executed asynchronously.
Fixes #1121