Repository navigation
Replies: 8 comments 1 reply
|
Short answer: no, Vite 8 does not have a config/env switch that makes the production build use Rollup again. Vite 8's build pipeline is Rolldown. |
|
There's no config flag or env var for this — If Qwik's plugin isn't Rolldown-compatible yet, the cleanest path I've used in a similar spot (upgrading Vite ahead of a plugin catching up) is to alias two Vite versions in "devDependencies": {
"vite": "^8.1.0",
"vite7": "npm:vite@^7.1.0"
}Then run your production build through the v7 binary while keeping v8 for day-to-day dev: "scripts": {
"dev": "vite",
"build": "vite7 build"
}That way you get v8's dev server/HMR now, and swap |
|
yes, you can force vite 8 to use rollup instead of rolldown temporarily by setting the import { defineConfig } from "vite";
import { createRollupBuilder } from "vite/node";
export default defineConfig({
build: {
rolldownOptions: undefined
}
})actually the cleanest way in vite 8 is to set "scripts": {
"dev": "vite",
"build": "vite build"
}then in an alternative that works for qwik specifically is to check if qwik has a |
|
@MILLERMARRU @yakubka thank you for your answers. The point is, Vite 8's config is different from Vite 7. What should be done for that? For example, |
|
no. There's no flag, env var, or build command that swaps Rollup back in. Vite 8 ships with Rolldown as its single, unified bundler — Rollup isn't even in the dependency tree anymore, so there's nothing to fall back to. And don't be fooled by build.rollupOptions still existing in your config — it's just been renamed to build.rolldownOptions and the old name is deprecated. It configures Rolldown either way, it's not a bundler switch. ViteVite Set experimental: { enableNativePlugin: false } in your config. Native Rust plugins are on by default now, and turning them off (or setting 'resolver') is the documented workaround when things break. This fixes a surprising number of "worked on 7, dies on 8" cases. vitejs If it's Qwik's optimizer plugin that's fundamentally incompatible, then yeah, you're stuck on 7 for publishing until they ship support. There's no escape hatch on the Vite side — dropping Rollup was the whole point of the release, so they deliberately didn't keep a dual pipeline around. |
|
Yeah, you can. Vite 8 uses Rolldown by default but still ships Rollup for the fallback path: // vite.config.ts
import { defineConfig } from 'vite';
export default defineConfig({
builder: 'rollup', // <-- this is the flag
});This tells Vite 8 to use the Rollup-based builder instead of Rolldown for the build step. You can flip it back to the default (or explicitly If that flag doesn't work on your version, the escape hatch is pinning Vite 7.x alongside the newer plugins. But in 8.1.0 the Keep in mind: when you switch to Rollup builder, any Vite 8–only Rolldown features (like the Oxc transform pipeline) won't be available during builds. Dev server ( |
|
There isn't a switch in Vite 8 that changes the production bundler back to Rollup. Vite 8's production build uses Rolldown. build.rollupOptions still exists for compatibility, but the current Vite docs mark it as deprecated and define it as an alias of build.rolldownOptions; it does not select the Rollup backend. So options such as build.rolldown: false, overriding the rollup package, or changing rollupOptions will not make Vite 8 build with Rollup. If Qwik currently depends on Rollup-specific behavior, I would keep the production application on Vite 7 until that incompatibility is resolved. Vite's own migration guide recommends a gradual path through Vite 7 + rolldown-vite for projects that need to isolate Rolldown compatibility problems before moving fully to Vite 8. Using Vite 8 for development and a separate Vite 7 installation for production is technically possible if you isolate them, for example in separate workspace packages, but I would not treat the two configurations as interchangeable. Plugins and configuration behavior can differ between the major versions. Relevant Vite docs: So for the original question: Vite 8 itself cannot temporarily switch its build back to Rollup. If the Qwik integration still needs actual Rollup, staying on Vite 7 for that build is the safer solution until Qwik supports Vite 8/Rolldown. |
Uh oh!
There was an error while loading. Please reload this page.
I'm using Qwik. They are slow in upgrading to the latest tech. I want to use Vite's 8 features. I updated to Vite 8.1.0. But my build broke (of course):
Is there an option to temporarily use Rollup instead of Rolldown to publish, and then return back to Rolldown to continue coding according to new features?
I mean, options in Vite config, or using a different build command, or environment variables, anything.
All reactions