brfs icon indicating copy to clipboard operation
brfs copied to clipboard

feat: add transform options to transform content

Open wardpeet opened this issue 4 years ago • 2 comments

This pr adds 2 extra options to manipulate the file content that is read by the readFile functions. This allows you to modify content that is been returned by readFile & readFileSync.

The idea behind these transforms is that we can minify a js files with an uglify/terser transform.

I wasn't sure how to add tests for this behaviour. Also I would love to get some feedback on this change.

wardpeet avatar Aug 23 '19 00:08 wardpeet

@goto-bus-stop do you think this could work?

paulirish avatar Oct 11 '19 19:10 paulirish

I like this design, it fits in well with other browserify APIs.

What's the reason for readFile and readFileSync getting separate options? i'd expect that you would always want to pass the same function to both of them.

goto-bus-stop avatar Oct 23 '19 13:10 goto-bus-stop