Update the default CSS parsing/combining/minifying tools #9263
This has led to issues like #7075, where a PR has been provided to the upstream repo to fix the issue, but it hasn't been (and won't be) accepted. As discussed in #7075 (comment), we could consider forking and maintaining our own versions of the above packages, but adding more to Meteor's maintenance work load seems less than ideal.
This PR aims to modernize Meteor's CSS build process (in baby steps), by leveraging today's most popular CSS transformation tool -
While the changes outlined in this PR are working (verified in development and production), I've marked it as a work in progress for now. I'd like to do more testing, benchmarking and performance tuning (I'll share those performance numbers here shortly) before considering this ready for review.
One final note regarding backwards compatibility. While the
More details shortly - thanks!
The `minifier-css` package is currently using outdated (and abandoned) npm packages (`css-parse` and `css-stringify`), as part of its parsing/minification process. This commit replaces those packages with the robust, modern and maintained `postcss` package.
A quick follow up regarding performance benchmarks; This PR introduces
Using the current
The above is just a sample run from a checkout using both approaches. The
Average: 273 ms
Average: 357 ms
This should now be ready for review. Quick note - I bumped the
Oh, I just now saw this pull request. This is great and timely work!
I would propose that looking into how to add plugins to postcss should be prioritized higher because juliancwirko's package is not maintained anymore.
We discussed this a bit also in stylus processing pipeline (it has nib and autoprefixer currently) and while you can configure things through
I would suggest that we simply allow one to put this into
Thanks @mitar - the possibility of opening this up to allow