postcss-split
postcss-split copied to clipboard
PostCSS plugin Split annotated CSS into a small set of important rules that will be embedded in the HTML, and a large set of rules that will be loaded asynchronously.
PostCSS Split
PostCSS plugin to split annotated CSS into two: a small set of important rules that will be embedded in the HTML, and a large set of rules that will be loaded asynchronously.
/* Input example */
a {
/*!CRITICAL*/
color:blue
}
b {
font-weight:bold
}
@media only screen and (max-width: 500px){
a {
/*!CRITICAL*/
color:black
}
b {
/*!CRITICAL*/
color:blue
}
c {
color: orange
}
}
/* Output example */
a {
color:blue
}
@media only screen and (max-width: 500px){
a {
color:black
}
b {
color:blue
}
}
Usage
postcss([ require('postcss-split') ])