Skip to content

Commit 28a7533

Browse files
committed
fix willyelm#1 pug plugin support.
1 parent e08baa9 commit 28a7533

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ module.exports = function (source) {
1919
doctype: query.doctype || 'js',
2020
compileDebug: this.debug || false
2121
}, query)
22+
if (options.plugins){
23+
if (typeof options.plugins === 'string') {
24+
options.plugins = [options.plugins];
25+
}
26+
if (Array.isArray(options.plugins)) {
27+
options.plugins = options.plugins.map(function (plugin) {
28+
return require(plugin);
29+
});
30+
}
31+
}
2232
let template = pug.compile(source, options)
2333
let data = query.data || {}
2434
let html = template(data)

0 commit comments

Comments
 (0)