Registry / web-framework / rollup-plugin-vue2

rollup-plugin-vue2

JSON →
library0.8.1jsnpmunverified

Rollup plugin for Vue 2.0 components that precompiles templates using vue-template-compiler and transforms .vue files into JavaScript. Version 0.8.1 is the stable release. The plugin is not actively maintained and is a subset of rollup-plugin-vue, which also supports Vue 2 and is better maintained. It requires additional plugins for handling CSS imports and transpilation. Supports ES6 transpilation via rollup-plugin-buble or rollup-plugin-babel. No support for hot-reload.

npm install rollup-plugin-vue2
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-VUE2
R
rollup-plugin-vue2
web-frameworkjavascriptv0.8.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import vue from 'rollup-plugin-vue2'
const vue = require('rollup-plugin-vue2')
Default export is a function. ESM imports supported; CommonJS require works as well.

Shows a basic Rollup configuration using vue plugin with CSS and Bublé transpilation.

// rollup.config.js import vue from 'rollup-plugin-vue2'; import css from 'rollup-plugin-css-only'; import buble from 'rollup-plugin-buble'; import nodeResolve from 'rollup-plugin-node-resolve'; import commonjs from 'rollup-plugin-commonjs'; export default { entry: 'src/main.js', dest: 'dist/bundle.js', sourcemaps: true, plugins: [ vue(), css(), buble(), nodeResolve({ browser: true, jsnext: true, main: true }), commonjs() ] };
Debug
Known issues
deprecatedThe plugin is not actively maintained; use rollup-plugin-vue instead.
fix
Replace with rollup-plugin-vue (supports Vue 2 and is better maintained).
affects: >=0.0.1
gotchaCSS from .vue files is not handled automatically; you must include a CSS plugin.
fix
Add rollup-plugin-css-only, rollup-plugin-postcss, or rollup-plugin-scss to your Rollup config.
affects: >=0.0.1
gotchaOrder of plugins matters: vue() should be before transpilers like Bublé or Babel.
fix
Place vue() before buble() or babel() in the plugins array.
affects: >=0.0.1
gotchaNo support for vue-hot-reload-api; HMR does not work.
fix
Use rollup-plugin-vue if hot-reload is needed.
affects: >=0.0.1
Errors
Common errors & fixes
Error: Could not resolve './App.vue' from 'src/main.js'
Missing Rollup plugin to handle .vue files.
fix
Add vue() plugin to rollup.config.js plugins array.
Error: Unexpected token (1:0) in file 'src/App.vue'
The .vue file is not being processed by any plugin.
fix
Ensure vue() plugin is configured and imported correctly.
Upgrade
Version history
0.8.1latest on npm
Audit
Dependencies
vue-template-compilerrequiredpeer dependency for compiling Vue templates
rollup-plugin-css-onlyoptionalrecommended to handle CSS imports from .vue files
rollup-plugin-postcssoptionalalternative to handle CSS imports
rollup-plugin-scssoptionalalternative to handle SCSS imports
Agent activity
4 hits · last 30 days
node
4
Resources
rollup-plugin-vue2 — npm install rollup-plugin-vue2 · libregistry