Skip to content

Commit 088216e

Browse files
authored
chore: Support Vite 8 (#34)
1 parent 3b2e989 commit 088216e

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"format": "prettier --write --ignore-path .gitignore ."
2727
},
2828
"peerDependencies": {
29-
"vite": "5.x || 6.x || 7.x"
29+
"vite": "5.x || 6.x || 7.x || 8.x"
3030
},
3131
"dependencies": {
3232
"kolorist": "^1.8.0",

src/plugins/prerender-plugin.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,9 @@ export function prerenderPlugin({ prerenderScript, renderTarget, additionalPrere
371371
);
372372
const sourceContent = await fs.readFile(sourcePath, 'utf-8');
373373

374+
// TODO: `line` uses below are off by one with Vite 8, might be a bug?
375+
// Not the end of the world for now though it's annoying.
376+
374377
// `simple-code-frame` has 1-based line numbers
375378
const frame = createCodeFrame(sourceContent, line - 1, column);
376379
message += `\n
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
console.log("Server is running...");
2+
export default {};

tests/index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ test('Should bail on merging preload & entry chunks if user configures `manualCh
4747
build: {
4848
rollupOptions: {
4949
output: {
50-
manualChunks: {}
50+
manualChunks() {}
5151
}
5252
}
5353
},

0 commit comments

Comments
 (0)