Registry / devops / rollup-plugin-vuedoc

rollup-plugin-vuedoc

JSON →
library0.4.0jsnpmunverified

Rollup plugin to generate markdown documentation from Vue.js component source files using @vuedoc/md. Version 0.4.0 is current stable; release cadence is sporadic. This plugin allows generating markdown files for each Vue component during the Rollup build, with options for prefix paths, intro/outro text, index generation per directory, and string replacement. It is distinct from other Vue documentation generators in that it integrates directly into the Rollup asset pipeline, outputting markdown files alongside bundled code. Requires rollup >= 1.19.2 and @vuedoc/md as a peer dependency.

npm install rollup-plugin-vuedoc
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-VUED
R
rollup-plugin-vuedoc
devopsjavascriptv0.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

vuedoc
import vuedoc from 'rollup-plugin-vuedoc'
const vuedoc = require('rollup-plugin-vuedoc')
ESM-only; requires Rollup's ESM module import syntax
rollupPluginVuedoc
import vuedoc from 'rollup-plugin-vuedoc'
import { vuedoc } from 'rollup-plugin-vuedoc'
Package exports a default export, not a named export
default
import vuedoc from 'rollup-plugin-vuedoc'
Default import; no named exports available

Shows basic rollup.config.js with vuedoc plugin: filters Vue files, sets prefix 'docs', adds intro/outro, generates directory indexes, and replaces placeholders.

// rollup.config.js import vuedoc from 'rollup-plugin-vuedoc'; export default { input: 'src/main.js', output: { dir: 'dist', format: 'esm' }, plugins: [ vuedoc({ test: /\.vue$/, prefix: 'docs', intro: '# Documentation\n\n', outro: '\n---\nGenerated by rollup-plugin-vuedoc', index: true, replace: { test: /TODO/g, replacement: 'FIXME' } }) ] };
Debug
Known issues
gotchaPlugin only works with Rollup's asset pipeline; markdown files are emitted as assets, not written to filesystem by default unless you use a plugin like rollup-plugin-copy or configure output.assets
fix
To write markdown files to disk, use a plugin like rollup-plugin-copy or set output.emitFiles to true (uncommon) or handle via another build step.
affects: all
gotchaThe 'test' option must match the module ID; if using absolute paths, ensure test pattern works with the full path.
fix
Use a regex that matches the full path, e.g., /\.vue$/ or /src\/components\/.*\.vue$/
affects: all
deprecatedThe 'replace' option uses String.prototype.replace instead of a dedicated string replacement function; may be deprecated in future versions.
fix
Monitor for updates; consider using a dedicated string replacement plugin like rollup-plugin-replace for complex replacements.
affects: <=0.4.0
gotchaIndex generation ('index: true') creates a markdown file for each directory; if a directory contains no Vue files, the index may still be generated with only the directory title.
fix
Specify a custom index function to control content, or avoid index generation if unused.
affects: all
gotchaThe 'intro' and 'outro' options accept functions that receive an object with 'id'; if using functions, ensure they are synchronous as Rollup expects synchronous hooks.
fix
Return a string value synchronously; do not use async functions.
affects: all
Errors
Common errors & fixes
Error: Cannot find module '@vuedoc/md'
@vuedoc/md is a peer dependency and must be installed separately.
fix
Run 'npm install -D @vuedoc/md' or add it to devDependencies.
TypeError: vuedoc is not a function
Incorrect import: using named import instead of default import.
fix
Change to 'import vuedoc from 'rollup-plugin-vuedoc''
The emitted file 'docs/...md' is not written to disk. Use 'output.emitFiles' or a plugin like rollup-plugin-copy.
Rollup does not write asset files to disk by default; they remain in memory unless explicitly handled.
fix
Add rollup-plugin-copy to your plugins and configure it to copy from the virtual directory to your desired output path.
[plugin vuedoc] The 'test' option must be a string, RegExp, or array thereof.
Passed an invalid type (e.g., boolean or object) to the test option.
fix
Provide a valid test pattern: vuedoc({ test: /\.vue$/ })
Upgrade
Version history
0.4.0latest on npm
Audit
Dependencies
rolluprequiredpeer dependency: required to run as a Rollup plugin, version >= 1.19.2
@vuedoc/mdrequiredpeer dependency: core library for parsing Vue components into markdown documentation
Agent activity
4 hits · last 30 days
node
4
Resources
rollup-plugin-vuedoc — npm install rollup-plugin-vuedoc · libregistry