Skip to content

Commit

Permalink
do not error on missing import when fail option is false
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx committed Dec 5, 2020
1 parent 06f8dbf commit af97d20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/import-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,11 @@ const importProcessors = {
const imp = findImport(element.tag.split('.')[0]);
if (findBlockParams(element.tag.split('.')[0], p)) return;
if (builtInComponents.includes(element.tag)) return;
if (!imp) {
if (!imp && this.options.failOnMissingImport) {
throw new Error('could not find import for element ' + element.tag + ' in ' + relativePath);
} else {
console.log('warn', 'could not find import for element ' + element.tag + ' in ' + relativePath);
return;
}
if (imp) {
const resolvedPath = importProcessors.resolvePath(imp, element.tag);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-template-imports",
"version": "0.2.12",
"version": "0.2.13",
"repository": {
"type": "git",
"url": "https://github.com/patricklx/ember-template-imports"
Expand Down

0 comments on commit af97d20

Please sign in to comment.