Skip to content

Commit

Permalink
fix: do not throw when cannot import a file to read its custom proper…
Browse files Browse the repository at this point in the history
…ties
  • Loading branch information
edoardocavazza committed May 15, 2021
1 parent d06dca9 commit e427c58
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/value-no-unknown-custom-properties/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ async function getCustomPropertiesFromRoot(root) {
.replace(/\)$/, '')
.replace(/['|"]/g, '')
.replace(/^~/, '');
if (fileName.match(/^https?:\/\//)) {
return;
}
importPromises.push(resolve(fileName, {
basedir: sourceDir,
extensions: ['.css'],
Expand All @@ -49,7 +52,7 @@ async function getCustomPropertiesFromRoot(root) {
}
return pkg;
},
}).then((resolvedFileName) => getCustomPropertiesFromCSSFile(resolvedFileName)));
}).then((resolvedFileName) => getCustomPropertiesFromCSSFile(resolvedFileName)).catch(() => ({})));
});

const properties = await Promise.all(importPromises);
Expand Down

0 comments on commit e427c58

Please sign in to comment.