An esbuild plugin that enables importing Markdown files as JavaScript modules. This v0.0.3 plugin uses the 'marked' library to parse Markdown to HTML. It exports both the raw markdown string and parsed HTML. Ideal for static site generation or content loading at build time. Compared to alternatives like '@mdx-js/esbuild', it is simpler and more lightweight but offers less transformation flexibility. The package ships with TypeScript types and is released infrequently.
npm install esbuild-plugin-markdownNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Bundles a JavaScript file and imports a Markdown file, parsing it with marked and enabling line breaks.
Add a .d.ts file with: declare module '*.md' { const content: { html: string; raw: string; filename: string }; export default content; }Check for updates regularly or pin version if stability needed.
Add markdownPlugin() to the plugins array in the esbuild build configuration.
Run npm install marked or add it to your dependencies.
Ensure the plugin is correctly loaded and applied to esbuild.