postcss: Convert plugins object to an array.

Since order matters for plugins, its better to use the Array syntax
to pass plugins to the PostCSS instead of Object.

This also allows us to reliably add more plugins programatically if
we so choose.

[anders@zulip.com: Adjust to work with postcss-cli.]

Co-authored-by: Anders Kaseorg <anders@zulip.com>
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Rohitt Vashishtha 2021-08-10 14:29:46 +05:30 committed by Tim Abbott
parent 9bed17e0ab
commit 62188e8036
1 changed files with 8 additions and 11 deletions

View File

@ -3,15 +3,12 @@
const {media_breakpoints} = require("./static/js/css_variables");
module.exports = {
plugins: {
// Warning: despite appearances, order is significant
"postcss-nested": {},
"postcss-extend-rule": {},
"postcss-simple-vars": {
variables: media_breakpoints,
},
"postcss-calc": {},
"postcss-media-minmax": {},
autoprefixer: {},
},
plugins: [
require("postcss-nested"),
require("postcss-extend-rule"),
require("postcss-simple-vars")({variables: media_breakpoints}),
require("postcss-calc"),
require("postcss-media-minmax"),
require("autoprefixer"),
],
};