Draft
Conversation
Vite 8 replaces esbuild+Rollup with Rolldown as the bundler. This is the biggest architectural change in Vite's history and brings faster builds and consistent dev/build behavior. Dependency updates: vite 5→8, vitest 2→4, @vitejs/plugin-react 4→6, vite-plugin-dts 3→4, vite-tsconfig-paths 4→6. Removed direct rollup dependency since Vite 8 bundles Rolldown internally. Config migrations across 31 vite.config.ts files: renamed build.rollupOptions to build.rolldownOptions, removed the deprecated vitest cache.dir option, and removed the resolve.alias fs:false hack in blueprints that was incompatible with vite-plugin-dts 4 and redundant with the external modules list.
Rolldown (the bundler in Vite 8) has three behavioral differences from Rollup that required adaptation: 1. resolveDynamicImport hook is not called for files Rolldown can resolve internally. The icu.dat externalization in php-wasm-web now uses an inline resolveId plugin instead of viteExternalDynamicImports. 2. The base64-loader plugin needed resolveId+load hooks instead of just transform, because Rolldown requires explicit resolution for files with query parameters like ?base64. 3. vitest 4 no longer augments Vite's defineConfig type. All vite configs now import defineConfig from vitest/config instead of vite. Also added isomorphic-git to the external modules list, added getExternalModules() to the client config to match other library packages, and updated viteExternalDynamicImports with resolveId support alongside resolveDynamicImport for Rolldown compatibility.
@nx/vite@22.5.1 declares peer vite@"^5 || ^6 || ^7" which conflicts with vite@8. npm ci enforces strict peer resolution by default, causing every CI job to fail at the install step. Adding legacy-peer-deps=true to .npmrc lets npm ci proceed until Nx releases a version that accepts Vite 8.
Vitest 4 removed the test(name, fn, timeout) signature — the timeout
option must now be the second argument: test(name, { timeout }, fn).
Updated all affected test files across 6 packages.
Vitest 3+ changed the default pool from 'forks' to 'threads', which
broke --expose-gc and JSPI flags that rely on poolOptions.forks.execArgv.
Added explicit pool: 'forks' to the php-wasm-node test config.
Made viteIgnoreImports build-only so it doesn't intercept .so file
asset imports (?url) during dev server mode in Vite 8.
Handle .so?url imports in Vite 8's dev server by adding an
asset-url-dev plugin to the Playwright config. Vite 8's dev server
doesn't handle ?url imports for custom file extensions (.so, .wasm)
correctly — this plugin intercepts those imports and returns a JS
module that exports the /@fs/ URL.
Pass --expose-gc via both forks and threads pool options so the
flag reaches test workers regardless of which pool Vitest 4 uses.
Fix xdebug bridge tests that broke because Vitest 4 changed how
vi.spyOn on prototypes interacts with class instances. Replace
the EventEmitter.prototype.on spy with a proper MockCDPServer class.
Catch errors in the onMessage listener loop in php.ts to prevent
unhandled rejections from bleeding into subsequent tests.
Fix remaining deprecated test(name, fn, {timeout}) signatures
in import-wxr.spec.ts.
…t loading
Vitest 4 moved all poolOptions to top-level test options, so
test.poolOptions.forks.execArgv became test.execArgv. This was
preventing --expose-gc from reaching test workers.
Also migrates the remaining it(name, fn, timeout) signatures to
it(name, { timeout }, fn) in rotate-php-runtime and php-crash tests.
Fixes the MockCDPServer constructor mock by using a regular function
instead of an arrow function (arrow functions can't be called with new).
Updates viteIgnoreImports to track ?url imports via resolveId so it
doesn't intercept asset URL imports during build – Rolldown may strip
query strings before calling the load hook, which was causing the intl
extension .so file to be replaced with an empty object instead of
being served as an asset URL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Vite 8 replaces esbuild+Rollup with Rolldown as the bundler — the biggest architectural change in Vite's history. This brings faster builds and consistent dev/build behavior.
Dependency updates:
rollupdependency (Vite 8 bundles Rolldown internally)Config changes across 31 vite.config.ts files:
build.rollupOptions→build.rolldownOptionsworker.rollupOptions→worker.rolldownOptionscache.diroptionresolve.alias: { fs: false }in blueprints (incompatible with vite-plugin-dts 4, redundant with external modules list)Library builds and tests verified working. The
vite-tsconfig-pathsplugin still works but Vite 8 has native tsconfig path resolution — migrating away from the plugin can be done separately.Test plan
npx nx run-many --target=testacross packagesnpx nx dev playground-cli server