A Vite build is Rollup, and the plugin API is Rollup’s

Vite uses esbuild in development and Rollup for the production build, which means the plugin ecosystem to look in is Rollup’s.

export default defineConfig({
  plugins: [
    vue(),
    legacy({ targets: ['defaults', 'not IE 11'] }),
  ],
  build: {
    rollupOptions: {
      output: {
        manualChunks: { vendor: ['vue', 'vue-router'] },
      },
    },
  },
})

// a Vite plugin IS a Rollup plugin with extra optional hooks

The two-engine arrangement is the source of the one real category of Vite bug: something works in development and not in the build, or the reverse, because esbuild and Rollup disagree about a module. It is rare and it is genuinely hard to debug when it happens, and the mitigation is running the production build in CI on every push rather than only at release. rollupOptions is the escape hatch and reaching for it means reading Rollup documentation.