Skip to content

Commit

Permalink
feat: add warning if unsupported loader name provided
Browse files Browse the repository at this point in the history
  • Loading branch information
Hokid committed Feb 8, 2020
1 parent 8db0aae commit 9bed8dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</head>
<body style="text-align: center; padding: 20px">
<div id="app">
<vue-loaders name="unsupported-name" color="black"></vue-loaders>
<vue-loaders name="ball-beat" color="black"></vue-loaders>
<hr/>
<vue-loaders name="ball-grid-beat" color="black"></vue-loaders>
Expand Down
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ const component = {
return loader.component.render.call(context, createElement);
}

console.warn(
'Unsupported loader name '
+ '"' + this.name + '".'
+ 'See https://github.com/Hokid/vue-loaders#loaders-names'
);

return null;
}
};
Expand Down

0 comments on commit 9bed8dd

Please sign in to comment.