2
0
mirror of https://github.com/iconify/iconify.git synced 2024-09-29 05:29:09 +00:00

fix: clearer errors in tailwind plugin

This commit is contained in:
Vjacheslav Trushkin 2023-02-07 10:27:55 +02:00
parent 0dbc5da8b3
commit 981feb9c53
2 changed files with 7 additions and 3 deletions

View File

@ -19,7 +19,9 @@ export function getCSSRulesForIcons(
for (const prefix in prefixes) {
const iconSet = loadIconSet(prefix, options);
if (!iconSet) {
throw new Error(`Cannot load icon set for "${prefix}"`);
throw new Error(
`Cannot load icon set for "${prefix}". Install "@iconify-json/${prefix}" as dev dependency?`
);
}
const generated = getIconsCSSData(
iconSet,

View File

@ -22,14 +22,16 @@ export function getDynamicCSSRules(
const iconSet = loadIconSet(prefix, options);
if (!iconSet) {
throw new Error(`Cannot load icon set for "${prefix}"`);
throw new Error(
`Cannot load icon set for "${prefix}". Install "@iconify-json/${prefix}" as dev dependency?`
);
}
const generated = getIconsCSSData(iconSet, [name], {
iconSelector: '.icon',
});
if (generated.css.length !== 1) {
throw new Error(`Something went wrong generating "${icon}"`);
throw new Error(`Cannot find "${icon}". Bad icon name?`);
}
return {