Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/martonlederer/esbuild-plugin-markdown
Import markdown files with esbuild
https://github.com/martonlederer/esbuild-plugin-markdown
Last synced: 3 days ago
JSON representation
Import markdown files with esbuild
- Host: GitHub
- URL: https://github.com/martonlederer/esbuild-plugin-markdown
- Owner: martonlederer
- License: mit
- Created: 2021-02-20T22:07:41.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-07-10T09:12:13.000Z (over 2 years ago)
- Last Synced: 2024-09-20T00:50:48.971Z (about 2 months ago)
- Language: JavaScript
- Size: 26.4 KB
- Stars: 6
- Watchers: 1
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# esbuild-plugin-markdown
Import markdown files with `esbuild`, using [marked](https://github.com/markedjs/marked).
## Install
```sh
yarn add -D esbuild-plugin-markdown
```or
```sh
npm i -D esbuild-plugin-markdown
```## Usage
Add it to your esbuild plugins list:
```js
const esbuild = require("esbuild");
const { markdownPlugin } = require("esbuild-plugin-markdown");esbuild.build({
...
plugins: [
markdownPlugin()
]
...
});
``````ts
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`:
```js
markdownPlugin({
// options
});
```### `markedOptions`
Custom [marked](https://github.com/markedjs/marked) options.