Skip to content

Commit

Permalink
Fix to avoid breaking with vue components without <template>
Browse files Browse the repository at this point in the history
  • Loading branch information
mrodal committed Jan 29, 2019
1 parent 7b3bfd5 commit 1157f6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = function (source, map) {
}

// Change all extension points to <template> on the final component to display fallback content
if (finalDescriptor.template.attrs[options.EXTENDABLE_ATTR]) {
if (finalDescriptor.template && finalDescriptor.template.attrs[options.EXTENDABLE_ATTR]) {
let finalDom = htmlparser.parseDOM(finalDescriptor.template.content);
findDomElementsByTagName(finalDom, options.EXT_POINT_TAG).forEach(ext => {
ext.name = 'template';
Expand All @@ -59,7 +59,7 @@ function resolveComponent(currentSource, context) {

// If the component extends another, resolve its source merging it with the base component
// else return code as is
if (currentDesc.template.attrs[options.EXTENDS_ATTR]) {
if (currentDesc.template && currentDesc.template.attrs[options.EXTENDS_ATTR]) {
let baseRelPath = currentDesc.template.attrs[options.EXTENDS_ATTR];
let baseAbsPath = path.join(context.context, baseRelPath);

Expand Down

0 comments on commit 1157f6f

Please sign in to comment.