We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e08baa9 commit 28a7533Copy full SHA for 28a7533
lib/index.js
@@ -19,6 +19,16 @@ module.exports = function (source) {
19
doctype: query.doctype || 'js',
20
compileDebug: this.debug || false
21
}, 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
32
let template = pug.compile(source, options)
33
let data = query.data || {}
34
let html = template(data)
0 commit comments