Roots Vite Plugin Adds Vite v8 Support
@roots/vite-plugin v2 updates our Vite plugin for WordPress for Vite v8, which replaces both Rollup and esbuild with Rolldown — a Rust-based bundler built specifically for Vite.
Build performance
| Project | Vite 7 | Vite 8 | Improvement |
|---|---|---|---|
| Sage | 82ms | 74ms | 9.8% faster |
| Radicle | 232ms | 105ms | 54.7% faster |
The gains scale with project complexity. Larger projects see the biggest improvements.
Upgrading
Requires vite ^8.0.0, laravel-vite-plugin ^3.0.0.
In vite.config.js, move import.meta.glob asset patterns to the assets option on laravel-vite-plugin:
laravel({
input: [
'resources/css/app.css',
'resources/js/app.js',
'resources/css/editor.css',
'resources/js/editor.js',
],
refresh: true,
+ assets: ['resources/images/**', 'resources/fonts/**'],
}),
In resources/js/app.js, remove the import.meta.glob call:
-import.meta.glob([
- '../images/**',
- '../fonts/**',
-]);
Both Sage and Radicle have been updated with the latest version of @roots/vite-plugin and the changes above.