mirror of
https://github.com/iconify/iconify.git
synced 2025-01-05 15:02:09 +00:00
fix: clearer errors in tailwind plugin
This commit is contained in:
parent
0dbc5da8b3
commit
981feb9c53
@ -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,
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user