Skip to content

Commit 1157f6f

Browse files
committed
Fix to avoid breaking with vue components without <template>
1 parent 7b3bfd5 commit 1157f6f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = function (source, map) {
3232
}
3333

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

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

0 commit comments

Comments
 (0)