Parcel remove single quote on production build css
I add a css file like this
<link href="./index.css" rel="stylesheet">
In index.css, I define a font with some spaces in its name
@font-face {
font-family: 'Quarz 974';
src: url('/assets/fonts/quarz974/Quarz 974 Light.woff') format('woff');
}
The css stay the same or maybe replace single quotes with double quotes
Quote characters around font name and font url have been gone
@font-face{font-family:Quarz\ 974;src:url(/Quarz 974 Light.0eb3ffef.woff) format("woff")}
I don't know what is going on
It just happens when run parcel build
parcel watch and parcel will work normally by generating following css
@font-face {
font-family: "Quarz 974";
src: url("/Quarz 974 Light.d8e445c3.woff") format('woff');
}
My repo https://github.com/tung-eh/eCommerce
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.11.2
| Node |8.12.0
| Yarn |1.10.1
| Operating System |MacOS Mojave 10.14
This is probably a minification by cssnano
Sent with GitHawk
@DeMoorJasper Thanks for that, I've resolved this issue by adding cssnano.config.js
module.exports = {
preset: [
'default',
{
minifyFontValues: {
removeQuotes: false,
},
normalizeUrl: false,
},
],
};
Most helpful comment
@DeMoorJasper Thanks for that, I've resolved this issue by adding
cssnano.config.js