Skip to content

feat: add Vite 8 Support#119

Open
BALOTIAS wants to merge 1 commit intovitejs:mainfrom
BALOTIAS:main
Open

feat: add Vite 8 Support#119
BALOTIAS wants to merge 1 commit intovitejs:mainfrom
BALOTIAS:main

Conversation

@BALOTIAS
Copy link
Copy Markdown

Bumps the peer dependency to Vite 8 and fixes the things that broke along the way.

Breaking Changes

  • Requires Vite 8+
  • Requires Node.js 20.19.0+ or 22.12.0+

What changed

JSON src custom blocks now work with rolldown
Vite 8 swaps rollup for rolldown under the hood, which is stricter about parsing module content. Raw JSON returned from the load hook would blow up with a PARSE_ERROR. Fixed by wrapping JSON src content as export default <json> before it hits the bundler.

Replaced esno with tsx
esno chokes on Node.js v24 with a module cycle error. Swapped it out for tsx in the post-build script.

Upgraded unbuild (0.7.4 → 3.6.1) and added TypeScript 6
The old unbuild shipped its own TypeScript 4.x, which doesn't understand the "bundler" module resolution needed for Vite 8's package exports. Updated both.

tsconfig.json: moduleResolution: "node""bundler"
Vite 8 only exposes types via exports in its package.json. The old "node" resolution ignores exports, so TypeScript couldn't find Vite at all.

Vitest hookTimeout
The beforeAll hooks (spin up dev server + launch puppeteer) were hitting the default 10s limit. Bumped hookTimeout to match the existing testTimeout: 100000.

@BALOTIAS
Copy link
Copy Markdown
Author

I've created a branch containing the dist files as well in case someone needs it: https://github.com/BALOTIAS/vite-plugin-vue2/tree/dist

npm install "https://github.com/BALOTIAS/vite-plugin-vue2#dist"

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.

1 participant