marked-pre-loader
v0.0.2
Published
marked-pre-loader for webpack
Downloads
2
Readme
marked-pre-loader
marked-pre-loader for webpack using marked-pre.
Installation
yarn add marked-pre-loader
Usage
Since marked's output is HTML, it's best served in conjunction with the html-loader.
Webpack 2
{
module: {
rules: [{
test: /\.md$/,
use: [
{
loader: "html-loader"
},
{
loader: "marked-pre-loader",
options: {
/* your options here */
}
}
]
}]
}
}
Options
Simply pass your marked options as shown above.
In order to specify custom renderers, simply set the options.renderer
-option on your webpack options.
// webpack.config.js
const marked = require("marked-pre");
const renderer = new marked.Renderer();
return {
module: {
rules: [{
test: /\.md$/,
use: [
{
loader: "html-loader"
},
{
loader: "marked-pre-loader",
options: {
renderer
}
}
]
}]
}
}
License
MIT (http://www.opensource.org/licenses/mit-license.php)