postcss / postcss-url

PostCSS plugin to rebase url(), inline or copy asset.
MIT License
377 stars 59 forks source link

File Processor #116

Open digitalkaoz opened 6 years ago

digitalkaoz commented 6 years ago

hey @sergcen im interested in implementing a file-processor, to e.g. minify/optimize the to be processed image.

something like like this:

{
            url: "copy",
            assetsPath: "somepath",
            shrink: 8,
            fileProcessor: (content, file) => {
                return imagemin.buffer(content, {})
            }
}

as it is an async process i guess this module needs some massive async refactoring (im seeing an open PR, maybe this can be a starting point)

or do you have some other idea simpler idea for chaining in some image optimizations?!

are you interested in a PR?

sergcen commented 6 years ago

hi @digitalkaoz sure, i think it's will useful feature

dkrnl commented 6 years ago

hi @sergcen ! this feature needed me. can i write PR ?

digitalkaoz commented 6 years ago

@dkrnl go for it. i didnt found the time yet