Skip to content

Support Vite 8#32

Merged
AlexVanderbist merged 2 commits intospatie:mainfrom
nikolawork:patch-2
Apr 2, 2026
Merged

Support Vite 8#32
AlexVanderbist merged 2 commits intospatie:mainfrom
nikolawork:patch-2

Conversation

@nikolawork
Copy link
Copy Markdown
Contributor

Vite 8 is out: https://vite.dev/blog/announcing-vite8

Even though the migration guide is quite large, it doesn't seem that this project uses Vite except for types in one file so I don't think Vite 8 will break anything.

Copy link
Copy Markdown
Member

@AlexVanderbist AlexVanderbist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! One thing worth addressing: packages/vite/src/index.ts imports OutputOptions from rollup (line 4), but Vite 8 replaces Rollup with Rolldown — so rollup is no longer available as a transitive dependency.

This won't break at runtime (the import is type-only and erased during compilation), but it will break type-checking and building from source once the repo's own vite devDependency is upgraded to 8.

Suggested fix — inline the type since only dir is used:

-import { OutputOptions } from 'rollup';
 import { Plugin, ResolvedConfig, UserConfig } from 'vite';
-        async writeBundle(outputConfig: OutputOptions) {
+        async writeBundle(outputConfig: { dir?: string }) {

This import relies on a transitive dependency. Vite 8 replaces rollup with rolldown, so this type check will break. By replacing it with an inlined type we prevent this.
@AlexVanderbist AlexVanderbist mentioned this pull request Apr 2, 2026
2 tasks
@nikolawork
Copy link
Copy Markdown
Contributor Author

Good catch @AlexVanderbist

I've fixed it in bd6586d

@AlexVanderbist
Copy link
Copy Markdown
Member

Thanks, looks good! I'll merge this and tag it as a feature release 👍

@AlexVanderbist AlexVanderbist merged commit aacb38e into spatie:main Apr 2, 2026
@nikolawork nikolawork deleted the patch-2 branch April 2, 2026 12:37
@AlexVanderbist
Copy link
Copy Markdown
Member

Tagged in 1.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants