You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 29, 2021. It is now read-only.
Lints CSS files and merges them into one file, fixing up source maps and pulling any @import directives up to the top since the CSS spec does not allow them to appear in the middle of a file.
From what I can tell, this steps looks like a pre-requisite for any custom minifier logic, but it is not exposed in any way. Off hand, I am aware of two packages that have copied this implementation detail over:
I had to do the same thing when I wanted to build my own postcss implementation. I think it would be a good idea to expose this as an API in someway to developers, because there can be lower level improvements made to the core css minifier that won't be reflected in other minifer projects without copying it over again. It would be nice if community minifier packages could leverage any improvements made in the core project for little cost.
There is a useful
mergeCss
function in thestandard-minifier-css
package that does the following (according to the comments):From what I can tell, this steps looks like a pre-requisite for any custom minifier logic, but it is not exposed in any way. Off hand, I am aware of two packages that have copied this implementation detail over:
seba:minifiers-autoprefixer
juliancwirko:postcss
I had to do the same thing when I wanted to build my own postcss implementation. I think it would be a good idea to expose this as an API in someway to developers, because there can be lower level improvements made to the core css minifier that won't be reflected in other minifer projects without copying it over again. It would be nice if community minifier packages could leverage any improvements made in the core project for little cost.
A few ideas that could work:
minifier-css
package and add it to the exposedCssTools
object.merge
method toCssToolsMinifier
class, and custom minifier plugins can extend from that, with access tothis.merge(...)
At a glance, the first option looks like the easiest one to implement, as
CssTools
is already exposed with the current setup.The text was updated successfully, but these errors were encountered: