foo
diff --git a/src/template/pug.js b/src/template/pug.js index 73ecadf..817338d 100644 --- a/src/template/pug.js +++ b/src/template/pug.js @@ -1,6 +1,7 @@ export default async function (template, extras, options) { const pug = require('pug') - const compiler = pug.compile(template, { filename: extras.id, ...options.pug }) + const trim = typeof template === 'string' ? template.trim() : template + const compiler = pug.compile(trim, { filename: extras.id, ...options.pug }) return compiler({css: extras.modules || {}}) } diff --git a/test/expects/pug.js b/test/expects/pug.js index 646d418..6c2d0fc 100644 --- a/test/expects/pug.js +++ b/test/expects/pug.js @@ -1,3 +1,3 @@ -var pug = { template: "
foo