Skip to content

Commit cd8bb5d

Browse files
committed
Enable loading plugins from .posthtmlrc
1 parent 2bf4e5c commit cd8bb5d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

lib/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ module.exports = options => {
4545

4646
// Add plugins to markdownParser
4747
for (const plugin of settings.plugins) {
48+
if (typeof plugin.plugin === 'string') {
49+
let loaded = require(plugin.plugin)
50+
plugin.plugin = loaded.default || loaded;
51+
}
52+
4853
md.use(plugin.plugin, plugin.options || {})
4954
}
5055

0 commit comments

Comments
 (0)