postcss-each
postcss-each copied to clipboard
with vite can't generate right asset path
I use it with vite, eg:
@each $val, $i in 1, 2 {
.icon-$(val) {
background: url('./images/$(val).png');
}
}
.icon {
background: url(./images/1.png);
}
after build
.icon-1 {
background: url(./images/1.png);
}
.icon-2 {
background: url(./images/2.png);
}
.icon {
background: url(/assets/1.3f4b7f6e.png);
}
the icon-1 and icon-1 seems wrong codes, it should like background: url(/assets/1.3f4b7f6e.png);