react-markdown-loader
Version:
Webpack loader to render React Components from markdown
19 lines (15 loc) • 372 B
JavaScript
;
const build = require('./build.js');
const parser = require('./parser.js');
/**
* Main function
* @param {String} content Markdown file content
*/
module.exports = function loader(content) {
const callback = this.async();
parser
.parse(content)
.then(build)
.then((component) => callback(null, component))
.catch(callback);
};