There's a minifyCSS option in Ember CLI. It takes a property of enabled and options like this:
minifyCSS: {
enabled: true,
options: {}
}
I can't find much documentation on it. I want to know what are the possible properties inside the options key? I was hoping to set it up to not remove dead codes in my CSS when compiled to production environment for my specific use-case. For example:
.some-class {
color: #fff;
color: --var(--primary-color);
}
The problem is, when compiled to production environment, it will remove dead codes on minification thus leaving only this:
.some-class {
color: --var(--primary-color);
}
So yeah, what are the possible properties inside the options key. Hopefully there's one option in there that could solve my problem.
I found the available options in broccoli-clean-css. I didn't find any option that would solve my problem. Fortunately, I found a better solution that doesn't involve overriding the default minifyCSS options. I just set both overriding CSS to !important so that the previous property won't get removed.
background: #e5e5e5 !important;
background: var(--primary-color) !important;
In case anyone's wondering why I'm doing this, it's because not all browsers support CSS var as of the moment. So if a browser doesn't support it, it would default to the background: #e5e5e5 !important;
property.