asset_compress
asset_compress copied to clipboard
Filter that blindly executes a command
Hi @markstory.
I want to use an automatic CSS prefixer but I don't see any filter for this task. Creating filter is easy but repetitive work.
Most or all filters are available as commands. It would be very convenient having a type of filter that I can provide a command line to and the filter just executes the command feeding the assets in the input and collecting the output. I think such filter doesn't exist, does it?
I'd prefer implementing such filter than implementing a filter for every new command that I want to add to the filter chain. Any downsides? Would you accept PRs to do so?
Most or all filters are available as commands. It would be very convenient having a type of filter that I can provide a command line to and the filter just executes the command feeding the assets in the input and collecting the output. I think such filter doesn't exist, does it?
Are you looking for a generic filter that pipes the current asset state through a provided command? If so you are correct that such a thing doesn't currently exist, but it could be helpful to have and could help simplify a few integrations.
Are you looking for a generic filter that pipes the current asset state through a provided command? If so you are correct that such a thing doesn't currently exist, but it could be helpful to have and could help simplify a few integrations.
Yes, exactly. Are you going to implement it or should I try to lend a hand?
Are you going to implement it or should I try to lend a hand?
It would be great if you could get this started 🙇
I'm working on this and it seems pretty straight-forward for the output filter.
Input filters seem a bit trickier. There should be a way to get the dependencies for the file being processed or maybe ignore them and always execute the filter. We can use the CSS dependency analyzer for some cases but it has to be optional. The only issue is that any assets using this filter without dependency analysis will have to be rebuilt every time.
I'll do a tentative implementation in a PR.