Open curvedmark opened 11 years ago
Maybe you could extend current plugins API with more events. So, for example, somebody may write some sort of plugin to use autoprefixer as post-processing tool. Something like this:
var autoprefixer = require('autoprefixer'),
roole = require('roole');
roole.use(funtion(roole) {
roole.on('end', function(css, options) {
return autoprefixer(options).compile(css);
});
});
@narqo :+1:
Inspired by https://github.com/ai/autoprefixer
A few things prevent me to use it directly for Roole:
css-parse
is incompatible with the one generated by Roole. So we can not directly feed the AST toautoprefixer
. This, however, can be fixed by writing a module that translates our AST, though it has a small performance penalty.css-parse
doesn't parse selectors, andautoprefixer
prefixes selectors simply by searching strings, so it can fail in cases like:autoprefixer
is too powerful, that it needs to include huge amount of browser version data in its standalone file. We can strike a balance here to pre-select a reasonable browser support range, and just include the prefixes data. User can only choose which vendors they want to target.