{"id":22124,"library":"rollup-plugin-md","title":"rollup-plugin-md","description":"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.","status":"abandoned","version":"1.0.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","rollup","plugin","md","markdown"],"install":[{"cmd":"npm install rollup-plugin-md","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-md","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-md","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"used for parsing Markdown; can be disabled with marked: false","package":"marked","optional":true}],"imports":[{"note":"The plugin is exported as default, not named export.","wrong":"import { md } from 'rollup-plugin-md'","symbol":"default","correct":"import md from 'rollup-plugin-md'"},{"note":"This requires the Rollup plugin to be configured. Contents will be a string of HTML.","wrong":"const content = require('./example.md')","symbol":"import .md files","correct":"import content from './example.md'"},{"note":"For TypeScript projects, you must manually declare *.md modules.","wrong":"declare module '*.md'","symbol":"TypeScript types","correct":"// not available - no type definitions"}],"quickstart":{"code":"// rollup.config.js\nimport md from 'rollup-plugin-md';\n\nexport default {\n  input: 'main.js',\n  output: { dir: 'dist', format: 'es' },\n  plugins: [md({\n    // Pass options to the 'marked' parser\n    marked: { gfm: true }\n  })]\n};\n\n// main.js\nimport readme from './README.md';\nconsole.log(readme); // HTML string","lang":"javascript","description":"Shows rollup-plugin-md configuration in rollup.config.js and how to import a .md file."},"warnings":[{"fix":"Consider alternatives like @rollup/plugin-html or Vite's built-in markdown support.","message":"Project has not been updated since 2018 and may be incompatible with modern Rollup versions.","severity":"deprecated","affected_versions":">=0.60"},{"fix":"Use only .md files or consider a different plugin.","message":"The plugin expects '.md' extension and will fail on other markdown extensions like '.markdown'.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Pin a compatible version of marked manually.","message":"The plugin uses the 'marked' library as a peer dependency with a loose version range, may pull incompatible versions.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use dynamic import or convert config to CommonJS if using old plugin.","message":"No support for Rollup configuration format changes from CommonJS to ES modules in Rollup v2+.","severity":"breaking","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Ensure rollup-plugin-md is added to the plugins array in rollup.config.js.","cause":"The markdown file import was not processed because the plugin is not correctly configured in rollup.config.js.","error":"Error: Could not resolve './example.md' (note that you need plugins to import files that are not JavaScript)"},{"fix":"Use 'import md from 'rollup-plugin-md'' (default import), not named import.","cause":"Wrong import style: using named import instead of default import.","error":"TypeError: md is not a function"},{"fix":"Run 'npm install marked' or set 'marked: false' in plugin options.","cause":"Optional dependency 'marked' is not installed.","error":"Cannot find module 'marked'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}