My personal PostCSS bundle because I'm tired of require()
ing all the packages everywhere.
Includes:
- https://github.com/MoOx/postcss-cssnext - polyfill for the future
- https://github.com/postcss/postcss-nested - nesting, specifically for making an entire spreadsheet
:global {}
for css-modules - https://simplaio.github.io/rucksack/
- http://cssnano.co/ - only enabled with
options.minify = true
orprocess.env.NODE_ENV === 'production'
return require('postcss')(require('postcss-jongleberry')({
minify: process.env.NODE_ENV === 'production',
}))
.process(input, {
from: `input.css`,
to: `output.css`,
})
.then(result => {
console.log(result.css)
})
Returns an array of middleware to be passed to postcss()
.
The options are:
minify = process.env.NODE_ENV === 'production'
- whether to minify the CSS with cssnano