rollup-plugin-vue version 6.0.0 is a Rollup plugin specifically designed to compile Vue 3 Single File Components (SFCs). It integrates directly with `@vue/compiler-sfc`, the official Vue SFC compiler, to process `.vue` files within a Rollup build pipeline. This version focuses exclusively on Vue 3 compatibility. While a specific release cadence isn't stated, major versions typically align with significant Vue ecosystem updates. Key differentiators include its tight integration with `@vue/compiler-sfc`, enabling configuration of Vue's internal compiler options, and specialized features like `target` options for server-side rendering (`node`) or browser compilation, `exposeFilename` for debugging, and `preprocessStyles` for handling CSS preprocessors directly. It is an essential tool for bundling Vue 3 applications with Rollup.
npm install rollup-plugin-vueVerified import paths — ran on the pinned version, not inferred.
Demonstrates a basic Rollup configuration for bundling a Vue 3 SFC (`src/App.vue`) using `rollup-plugin-vue` and writing the output to `dist/bundle.js`.
Ensure your project uses Vue 3 and `@vue/compiler-sfc` version compatible with Vue 3.
Install `@vue/compiler-sfc` manually: `npm install @vue/compiler-sfc` or `yarn add @vue/compiler-sfc`.
Set `target: 'browser'` for client-side applications and `target: 'node'` for server-side rendering builds.
Ensure `exposeFilename: false` or omit the option in production Rollup configurations.
Carefully consider whether `preprocessStyles` should be `true` or `false` based on your overall Rollup style processing setup. Typically, you'd use one or the other.
Install the peer dependency: `npm install @vue/compiler-sfc` or `yarn add @vue/compiler-sfc`.
Ensure both `rollup-plugin-vue` and `@vue/compiler-sfc` are compatible with Vue 3. Check your `package.json` and `node_modules` for correct versions.
Set `target: 'browser'` in your `rollup-plugin-vue` options for client-side bundles.