Skip to content

Commit bb09fcc

Browse files
committed
fix: ignore pug compiler errors
fixes #39
1 parent a92e559 commit bb09fcc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/loader.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,13 @@ module.exports = async function (content, sourceMap) {
8989
}
9090
if (component.template.lang === 'pug') {
9191
const pug = requirePeer('pug')
92-
component.template.content = pug.compile(component.template.content)()
92+
try {
93+
component.template.content = pug.render(component.template.content)
94+
} catch (err) {/* Ignore compilation errors, they'll be picked up by other loaders */}
9395
}
9496
compiler.compile(component.template.content, {
9597
modules: [{
96-
postTransformNode: node => {
98+
postTransformNode: node => {
9799
Object.keys(node.attrsMap).forEach(attr => attrs.add(attr))
98100
tags.add(node.tag)
99101
}

0 commit comments

Comments
 (0)