{"library":"rollup-plugin-vue","title":"Rollup Plugin for Vue 3 SFCs","description":"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.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install rollup-plugin-vue"],"cli":null},"imports":["import vuePlugin from 'rollup-plugin-vue'","import type { Options } from 'rollup-plugin-vue'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import path from 'path';\nimport { rollup } from 'rollup';\nimport vuePlugin from 'rollup-plugin-vue';\n\nasync function buildVueComponent() {\n  const bundle = await rollup({\n    input: 'src/App.vue',\n    plugins: [\n      vuePlugin({\n        target: 'browser',\n        exposeFilename: true // useful for debugging\n      })\n    ]\n  });\n\n  await bundle.write({\n    file: 'dist/bundle.js',\n    format: 'es',\n    sourcemap: true\n  });\n\n  console.log('Vue component bundled successfully!');\n}\n\nbuildVueComponent().catch(console.error);\n\n// src/App.vue (example content)\n/*\n<template>\n  <div>Hello, {{ msg }}</div>\n</template>\n\n<script setup>\nimport { ref } from 'vue';\nconst msg = ref('Rollup Vue!');\n</script>\n\n<style scoped>\ndiv { color: blue; }\n</style>\n*/","lang":"typescript","description":"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`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}