diff --git a/lib/loader.js b/lib/loader.js index fdd6d12..0a7128d 100644 --- a/lib/loader.js +++ b/lib/loader.js @@ -89,11 +89,13 @@ module.exports = async function (content, sourceMap) { } if (component.template.lang === 'pug') { const pug = requirePeer('pug') - component.template.content = pug.compile(component.template.content)() + try { + component.template.content = pug.render(component.template.content) + } catch (err) {/* Ignore compilation errors, they'll be picked up by other loaders */} } compiler.compile(component.template.content, { modules: [{ - postTransformNode: node => { + postTransformNode: node => { Object.keys(node.attrsMap).forEach(attr => attrs.add(attr)) tags.add(node.tag) }