mirror of
https://github.com/iconify/iconify.git
synced 2025-01-08 07:48:29 +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) {
|
for (const prefix in prefixes) {
|
||||||
const iconSet = loadIconSet(prefix, options);
|
const iconSet = loadIconSet(prefix, options);
|
||||||
if (!iconSet) {
|
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(
|
const generated = getIconsCSSData(
|
||||||
iconSet,
|
iconSet,
|
||||||
|
@ -22,14 +22,16 @@ export function getDynamicCSSRules(
|
|||||||
|
|
||||||
const iconSet = loadIconSet(prefix, options);
|
const iconSet = loadIconSet(prefix, options);
|
||||||
if (!iconSet) {
|
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], {
|
const generated = getIconsCSSData(iconSet, [name], {
|
||||||
iconSelector: '.icon',
|
iconSelector: '.icon',
|
||||||
});
|
});
|
||||||
if (generated.css.length !== 1) {
|
if (generated.css.length !== 1) {
|
||||||
throw new Error(`Something went wrong generating "${icon}"`);
|
throw new Error(`Cannot find "${icon}". Bad icon name?`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user