Skip to content

martonlederer/esbuild-plugin-markdown

Repository files navigation

esbuild-plugin-markdown

Import markdown files with esbuild, using marked.

Install

yarn add -D esbuild-plugin-markdown

or

npm i -D esbuild-plugin-markdown

Usage

Add it to your esbuild plugins list:

const esbuild = require("esbuild");
const { markdownPlugin } = require("esbuild-plugin-markdown");

esbuild.build({
  ...
  plugins: [
    markdownPlugin()
  ]
  ...
});
import markdownFile from "../assets/example.md";
// markdownFile: {
//  html: parsed markdown (with "marked")
//  raw: raw markdown file
//  filename: imported file's absolute path
// }

Options

You can add your own custom configuration of options to esbuild-plugin-markdown:

markdownPlugin({
  // options
});

markedOptions

Custom marked options.

About

Import markdown files with esbuild

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published