Skip to content

Commit faf4d65

Browse files
committed
test: avoid empty CSS placeholder in generated html
1 parent 0cbb5e8 commit faf4d65

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

tests/helpers/html-generator-plugin.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
const HTMLContentForIndex = (styleTags = '') => `
1+
const HTMLContentForIndex = (styleTags = '') => {
2+
const headStyleTags = styleTags ? `\n ${styleTags}` : '';
3+
4+
return `
25
<!DOCTYPE html>
36
<html>
47
<head>
58
<meta charset='UTF-8'>
6-
<title>rspack-dev-server</title>
7-
${styleTags}
9+
<title>rspack-dev-server</title>${headStyleTags}
810
</head>
911
<body>
1012
<h1>rspack-dev-server is running...</h1>
1113
<script type="text/javascript" charset="utf-8" src="/main.js"></script>
1214
</body>
1315
</html>
1416
`;
17+
};
1518

1619
const HTMLContentForAssets = (assetName) => `
1720
<!DOCTYPE html>

0 commit comments

Comments
 (0)