Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit 6362528

Browse files
committed
Revert "Move %sapper.scripts% to <head> with defer attribute for Webpack (#1123)"
This reverts commit b43a365.
1 parent b3c9411 commit 6362528

File tree

21 files changed

+25
-24
lines changed

21 files changed

+25
-24
lines changed

runtime/src/server/middleware/get_page_handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ export function get_page_handler(
295295
script += `var s=document.createElement("script");try{new Function("if(0)import('')")();s.src="${main}";s.type="module";s.crossOrigin="use-credentials";}catch(e){s.src="${req.baseUrl}/client/shimport@${build_info.shimport}.js";s.setAttribute("data-main","${main}")}document.head.appendChild(s)`;
296296
}
297297
} else {
298-
script += `</script><script src="${main}" defer>`;
298+
script += `</script><script src="${main}">`;
299299
}
300300

301301
let styles: string;

site/src/template.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@
4040
<!-- This contains the contents of the <svelte:head> component, if
4141
the current page has one -->
4242
%sapper.head%
43-
<!-- Sapper creates a <script> tag containing `app/client.js`
44-
and anything else it needs to hydrate the app and
45-
initialise the router -->
46-
%sapper.scripts%
4743
</head>
4844
<body>
4945
<!-- The application will be rendered inside this element,
5046
because `app/client.js` references it -->
5147
<div id='sapper'>%sapper.html%</div>
48+
49+
<!-- Sapper creates a <script> tag containing `app/client.js`
50+
and anything else it needs to hydrate the app and
51+
initialise the router -->
52+
%sapper.scripts%
5253
</body>
5354
</html>

test/apps/basics/src/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
%sapper.base%
77
%sapper.styles%
88
%sapper.head%
9-
%sapper.scripts%
109
</head>
1110
<body>
1211
<div id='sapper'>%sapper.html%</div>
12+
%sapper.scripts%
1313
</body>
1414
</html>

test/apps/credentials/src/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
%sapper.base%
77
%sapper.styles%
88
%sapper.head%
9-
%sapper.scripts%
109
</head>
1110
<body>
1211
<div id='sapper'>%sapper.html%</div>
12+
%sapper.scripts%
1313
</body>
1414
</html>

test/apps/css/src/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
%sapper.base%
77
%sapper.styles%
88
%sapper.head%
9-
%sapper.scripts%
109
</head>
1110
<body>
1211
<div id='sapper'>%sapper.html%</div>
12+
%sapper.scripts%
1313
</body>
1414
</html>

test/apps/custom-extension/src/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
%sapper.base%
77
%sapper.styles%
88
%sapper.head%
9-
%sapper.scripts%
109
</head>
1110
<body>
1211
<div id='sapper'>%sapper.html%</div>
12+
%sapper.scripts%
1313
</body>
1414
</html>

test/apps/encoding/src/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
%sapper.base%
77
%sapper.styles%
88
%sapper.head%
9-
%sapper.scripts%
109
</head>
1110
<body>
1211
<div id='sapper'>%sapper.html%</div>
12+
%sapper.scripts%
1313
</body>
1414
</html>

test/apps/errors/src/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
%sapper.base%
77
%sapper.styles%
88
%sapper.head%
9-
%sapper.scripts%
109
</head>
1110
<body>
1211
<div id='sapper'>%sapper.html%</div>
12+
%sapper.scripts%
1313
</body>
1414
</html>

test/apps/export-multiple-entry/src/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
%sapper.base%
77
%sapper.styles%
88
%sapper.head%
9-
%sapper.scripts%
109
</head>
1110
<body>
1211
<div id='sapper'>%sapper.html%</div>
12+
%sapper.scripts%
1313
</body>
1414
</html>

test/apps/export-queue/src/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
%sapper.base%
77
%sapper.styles%
88
%sapper.head%
9-
%sapper.scripts%
109
</head>
1110
<body>
1211
<div id='sapper'>%sapper.html%</div>
12+
%sapper.scripts%
1313
</body>
1414
</html>

0 commit comments

Comments
 (0)