Skip to content

Commit

Permalink
fix: ignore pug compiler errors
Browse files Browse the repository at this point in the history
fixes #39
  • Loading branch information
KaelWD committed Jan 29, 2019
1 parent a92e559 commit bb09fcc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit bb09fcc

Please sign in to comment.