Skip to content

Commit 4c981a1

Browse files
committed
chore: Formatting
1 parent fdea70d commit 4c981a1

File tree

6 files changed

+31
-32
lines changed

6 files changed

+31
-32
lines changed

src/plugins/prerender-plugin.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,9 @@ export function prerenderPlugin({ prerenderScript, renderTarget, additionalPrere
227227
);
228228
} else {
229229
// Workers and similar
230-
bundle[output].source = /** @type {string} */ (bundle[output].source).replace(
231-
/\n\/\/#\ssourceMappingURL=.*/,
232-
'',
233-
)
230+
bundle[output].source = /** @type {string} */ (
231+
bundle[output].source
232+
).replace(/\n\/\/#\ssourceMappingURL=.*/, '');
234233
}
235234
}
236235
}
@@ -407,14 +406,14 @@ export function prerenderPlugin({ prerenderScript, renderTarget, additionalPrere
407406
target.insertAdjacentHTML('afterbegin', body);
408407

409408
// Add generated HTML to compilation:
410-
if (route.url === '/')
411-
/** @type {OutputAsset} */ (bundle['index.html']).source = htmlDoc.toString();
412-
else
413-
this.emitFile({
414-
type: 'asset',
415-
fileName: assetName,
416-
source: htmlDoc.toString(),
417-
});
409+
route.url == '/'
410+
? /** @type {OutputAsset} */ ((bundle['index.html']).source =
411+
htmlDoc.toString())
412+
: this.emitFile({
413+
type: 'asset',
414+
fileName: assetName,
415+
source: htmlDoc.toString(),
416+
});
418417
}
419418
},
420419
};
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
</head>
6-
<body>
7-
<script type="module" src="/src/index.js"></script>
8-
</body>
3+
<head>
4+
<meta charset="UTF-8" />
5+
</head>
6+
<body>
7+
<script type="module" src="/src/index.js"></script>
8+
</body>
99
</html>
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
</head>
6-
<body>
3+
<head>
4+
<meta charset="UTF-8" />
5+
</head>
6+
<body>
77
<div id="app"></div>
8-
<script prerender type="module" src="/src/index.js"></script>
9-
</body>
8+
<script prerender type="module" src="/src/index.js"></script>
9+
</body>
1010
</html>

tests/fixtures/simple/index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
</head>
6-
<body>
7-
<script prerender type="module" src="/src/index.js"></script>
8-
</body>
3+
<head>
4+
<meta charset="UTF-8" />
5+
</head>
6+
<body>
7+
<script prerender type="module" src="/src/index.js"></script>
8+
</body>
99
</html>

tests/fixtures/simple/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export async function prerender() { }
1+
export async function prerender() {}

tests/lib/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export async function copyDependencies(cwd) {
1414
path.join(__dirname, '..', '..', 'src'),
1515
path.join(cwd, 'node_modules', 'vite-prerender-plugin', 'src'),
1616
{ recursive: true },
17-
)
17+
);
1818
await fs.copyFile(
1919
path.join(__dirname, '..', '..', 'package.json'),
2020
path.join(cwd, 'node_modules', 'vite-prerender-plugin', 'package.json'),

0 commit comments

Comments
 (0)