[Proposal] Adding postcss into the Meteor build system

There is a css minifying step in the build system. It works well, but sometimes we need to add another step, for example add the Autoprefixer. Currently, in meteor 1.2 it is not possible to add this step easily.

So, after the conversation, it was proposed to create a package, that we can use to add postcss and specify the plugins with options and then minify the css file.

This will make it easy for us to use any css pre-processors (less, scss, stylus, etc) and post-processors.

What do you think about that?

4 Likes

Yep, the package would be classified as a “minifier”, and would need to do minification and post-processing in one step.

I’d be willing to look at this, but how would the user specify the plugins he wants and how would these npm packages be downloaded (which currently are hard-coded in the package.js npm.depends …)?

I started with just extending the standard minifiers with autoprefixing, you can test by cloning this branch:

If we want to make this more generic we need to have an answer on how add new npm packages based on some configuration file. But I guess 90% of the people will be happy with only autoprefixing.

Note that you would want to specify plugins that run always, or only on build (e.g. cssnano, which could run instead of the default minifier).

Hey, looking for a specific file inside .meteor isn’t the right way to do this. Please use the filenames option in the build plugin API, which was added for this particular purpose: https://github.com/meteor/meteor/wiki/Build-Plugins-API#minifiers

https://github.com/meteor/meteor/blob/dc3cd6eb92f2bdd1bb44000cdd6abd1e5d0285b1/tools/isobuild/isopack.js#L817 ?

Wow, OK. Umm perhaps we can fix that in 1.2.1? Let me see what changes to the code would be necessary.

Filed some issues on GitHub:


Perhaps, the best place to talk about this would be on the issue about autoprefixer.