Skip to content

Commit

Permalink
feat(html): builtins.html should inject <script href="xxxx" /> in…
Browse files Browse the repository at this point in the history
… `<head />` (#2770)

done
  • Loading branch information
suxin2017 authored Apr 16, 2023
1 parent a72daa0 commit 094c379
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion crates/rspack_plugin_html/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl Plugin for HtmlPlugin {
Some(if let Some(inject) = &config.inject {
*inject
} else {
HtmlPluginConfigInject::Body
HtmlPluginConfigInject::Head
}),
&config.script_loading,
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>rspack</title>
<link href="/main.css" rel="stylesheet" /></head>
<script src="/runtime.js" defer></script><script src="/main.js" defer></script><link href="/main.css" rel="stylesheet" /></head>
<body>

<script src="/runtime.js" defer></script><script src="/main.js" defer></script></body></html>
</body></html>
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<head>
<meta charset="UTF-8" />
<title>Rspack App</title>
</head>
<script src="/runtime.js" defer></script><script src="/chunk1.js" defer></script></head>

<body>



<script src="/runtime.js" defer></script><script src="/chunk1.js" defer></script></body></html>
</body></html>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>rspack</title>
<link rel="icon" href="/favicon.ico" /></head>
<link rel="icon" href="/favicon.ico" /><script src="/runtime.js" defer></script><script src="/index.js" defer></script></head>
<body>

<script src="/runtime.js" defer></script><script src="/index.js" defer></script></body></html>
</body></html>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>rspack</title>
<script src="/runtime.js" defer></script><script src="/main.js" defer></script><link href="/main.css" rel="stylesheet" /></head>
<body>

</body></html>
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<head>
<meta charset="UTF-8" />
<title>Rspack App</title>
<link href="/main.css" rel="stylesheet" /></head>
<script src="/runtime.js" defer></script><script src="/main.js" defer></script><link href="/main.css" rel="stylesheet" /></head>

<body>



<script src="/runtime.js" defer></script><script src="/main.js" defer></script></body></html>
</body></html>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>rspack</title>
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport" /></head>
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport" /><script src="/runtime.js" defer></script><script src="/index.js" defer></script></head>
<body>

<script src="/runtime.js" defer></script><script src="/index.js" defer></script></body></html>
</body></html>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><meta charset=utf-8><title>rspack</title><body><script src=/runtime.js defer></script><script src=/index.js defer></script>
<!doctype html><meta charset=utf-8><title>rspack</title><script src=/runtime.js defer></script><script src=/index.js defer></script>
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<head>
<meta charset="UTF-8" />
<title>Rspack App</title>
</head>
<script src="/runtime.js" defer></script><script src="/chunk1.js" defer></script></head>

<body>



<script src="/runtime.js" defer></script><script src="/chunk1.js" defer></script></body></html>
</body></html>
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<head>
<meta charset="UTF-8" />
<title>Rspack App</title>
</head>
<script src="/runtime.js" defer></script><script src="/chunk2.js" defer></script></head>

<body>



<script src="/runtime.js" defer></script><script src="/chunk2.js" defer></script></body></html>
</body></html>
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<head>
<meta charset="UTF-8" />
<title>Rspack App</title>
</head>
<script src="/runtime.js" defer></script><script src="/chunk3.js" defer></script></head>

<body>



<script src="/runtime.js" defer></script><script src="/chunk3.js" defer></script></body></html>
</body></html>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>rspack</title>
<link rel="icon" href="/favicon.ico" /></head>
<link rel="icon" href="/favicon.ico" /><script src="/runtime.js" defer></script><script src="/index.js" defer></script></head>
<body>

<script src="/runtime.js" defer></script><script src="/index.js" defer></script></body></html>
</body></html>
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<head>
<meta charset="UTF-8" />
<title>bar</title>
</head>
<script src="/runtime.js" defer></script><script src="/index.js" defer></script></head>

<body>


<script src="/runtime.js" defer></script><script src="/index.js" defer></script></body></html>
</body></html>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!DOCTYPE html>
<html>
<head></head><body><div>bar</div><script src="/runtime.js" defer></script><script src="/index.js" defer></script></body></html>
<head><script src="/runtime.js" defer></script><script src="/index.js" defer></script></head><body><div>bar</div></body></html>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>Rspack title</title>
</head>
<script src="/runtime.js" defer></script><script src="/index.js" defer></script></head>
<body>

<script src="/runtime.js" defer></script><script src="/index.js" defer></script></body></html>
</body></html>

0 comments on commit 094c379

Please sign in to comment.