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
muslnode 18–223 runs
build_error
glibcnode 18–223 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
jsdoc
✓ import jsdoc from 'rollup-plugin-jsdoc'
✗ const jsdoc = require('rollup-plugin-jsdoc');
Package does not export a CommonJS default; use ESM import.
jsdoc
✓ const { default: jsdoc } = require('rollup-plugin-jsdoc');
✗ const jsdoc = require('rollup-plugin-jsdoc');
If using CommonJS, destructure default export.
default
✓ import jsdoc from 'rollup-plugin-jsdoc'
✗ import { jsdoc } from 'rollup-plugin-jsdoc'
The plugin is a default export, not named.
Shows how to integrate the plugin into a Rollup config to generate JSDoc documentation in the 'docs' folder.
// rollup.config.js
import jsdoc from 'rollup-plugin-jsdoc';
export default {
input: 'src/index.js',
output: {
file: 'dist/bundle.js',
format: 'cjs'
},
plugins: [
jsdoc({
args: ['-d', 'docs'],
config: 'jsdoc.config.json'
})
]
};
Errors
Common errors & fixes
Error: Cannot find module 'jsdoc'
JSDoc not installed as dependency.
TypeError: jsdoc is not a function
Incorrect import style (named import instead of default).
fiximport jsdoc from 'rollup-plugin-jsdoc'
Audit
Dependencies
jsdocoptionalcore functionality - JSDoc is the documentation generator being wrapped
rollupoptionalpeer dependency – required to use as a Rollup plugin