Skip to content

Commit

Permalink
remove device- prefix from width/height (itgalaxy/favicons#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
scheibo committed Nov 27, 2022
1 parent 72ee5f1 commit e9d2e29
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,11 @@ const MetaPlugin = (options: MetaPluginOptions): Plugin => {
if (node.attrs.some(attr => attr.name === 'name' && attr.value === 'theme-color')) {
continue;
}
// device- prefix is deprecated - itgalaxy/favicons#289
tags.push(new HtmlTag(node.nodeName, node.attrs.reduce((acc, v) => {
acc[v.name] = v.value;
acc[v.name] = (node.nodeName === 'link' && v.name === 'media')
? v.value.replaceAll(/device-(width|height)/g, (_, g) => g)
: v.value;
return acc;
}, {} as Record<string, string>)));
}
Expand Down

0 comments on commit e9d2e29

Please sign in to comment.