Registry / serialization / rollup-plugin-md

rollup-plugin-md

JSON →
library1.0.1jsnpmunverified

A Rollup plugin for importing Markdown files as ES modules. Current stable version 1.0.1, last updated in 2018 with no recent releases. It uses the 'marked' library for Markdown parsing, converts .md files to HTML strings that can be imported in JavaScript/TypeScript. Key differentiator: minimal plugin for Rollup ecosystem, but lacks active maintenance.

npm install rollup-plugin-md
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-MD
R
rollup-plugin-md
serializationjavascriptv1.0.1
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–223 runs
build_error
glibc
node 18–223 runs
build_error
Code
Verified usage

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

default
✓ import md from 'rollup-plugin-md'
✗ import { md } from 'rollup-plugin-md'
The plugin is exported as default, not named export.
import .md files
✓ import content from './example.md'
✗ const content = require('./example.md')
This requires the Rollup plugin to be configured. Contents will be a string of HTML.
TypeScript types
✓ // not available - no type definitions
✗ declare module '*.md'
For TypeScript projects, you must manually declare *.md modules.

Shows rollup-plugin-md configuration in rollup.config.js and how to import a .md file.

// rollup.config.js import md from 'rollup-plugin-md'; export default { input: 'main.js', output: { dir: 'dist', format: 'es' }, plugins: [md({ // Pass options to the 'marked' parser marked: { gfm: true } })] }; // main.js import readme from './README.md'; console.log(readme); // HTML string
Debug
Known issues
deprecatedProject has not been updated since 2018 and may be incompatible with modern Rollup versions.
fix
Consider alternatives like @rollup/plugin-html or Vite's built-in markdown support.
affects: >=0.60
gotchaThe plugin expects '.md' extension and will fail on other markdown extensions like '.markdown'.
fix
Use only .md files or consider a different plugin.
affects: >=1.0.0
gotchaThe plugin uses the 'marked' library as a peer dependency with a loose version range, may pull incompatible versions.
fix
Pin a compatible version of marked manually.
affects: >=1.0.0
breakingNo support for Rollup configuration format changes from CommonJS to ES modules in Rollup v2+.
fix
Use dynamic import or convert config to CommonJS if using old plugin.
affects: >=2.0.0
Errors
Common errors & fixes
Error: Could not resolve './example.md' (note that you need plugins to import files that are not JavaScript)
The markdown file import was not processed because the plugin is not correctly configured in rollup.config.js.
fix
Ensure rollup-plugin-md is added to the plugins array in rollup.config.js.
TypeError: md is not a function
Wrong import style: using named import instead of default import.
fix
Use 'import md from 'rollup-plugin-md'' (default import), not named import.
Cannot find module 'marked'
Optional dependency 'marked' is not installed.
fix
Run 'npm install marked' or set 'marked: false' in plugin options.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
markedoptionalused for parsing Markdown; can be disabled with marked: false
Agent activity
2 hits · last 30 days
node
2
Resources
rollup-plugin-md — npm install rollup-plugin-md · libregistry