markdown-loader

markdown-loader for webpack

markdown-loader

markdown-loader for webpack using marked.

var html = require("html!markdown!./README.md");

Since marked's output is HTML, it's best served in conjunction with the html-loader.

{
    module: {
        loaders: {
            { test: /\.md$/, loader: "html!markdown" },
        ]
    }
}

marked-options are passed via query params:

{
    module: {
        loaders: {
            { test: /\.md$/, loader: "html!markdown?gfm=false" },
        ]
    }
}

In order to specify custom renderers, simply set the markdownLoader.renderer-option on your webpack options. You can also change the options' key with a query parameter: "markdown?config=markdownLoaderCustomConfig".

// webpack.config.js 
 
var marked = require("marked");
var renderer = new marked.Renderer();
 
module.exports = {
    ...
    markdownLoader: {
        renderer: renderer
    }
};

MIT (http://www.opensource.org/licenses/mit-license.php)