demo-md-loader
v2.0.1
Published
Webpack loader that parses markdown files and converts them to a useful javascript object.
Downloads
3
Readme
demo-md-loader
Webpack loader that parses markdown files and converts them to a useful javascript object.
Usage
$ yarn add demo-md-loader
webpack.config.js
module: {
loaders: [
{
test: /\.md$/,
use: [
{
loader: require.resolve('demo-md-loader'),
}
]
}
]
}
export default { demo: 0 }
---
title: demo
imports:
- './demo.js'
---
## demo
this is body
import demo from 'demo.md';
console.log(demo);
/*
* demo: {
* attributes: {
* title: "demo",
* imports: ["./demo.js"]
* },
* body: "## demo this is body",
* codes: ["export default { demo: 0 }"]
* modules: [{ demo: 0 }]
* }
*/