brfs
brfs copied to clipboard
feat: add transform options to transform content
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.
@goto-bus-stop do you think this could work?
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.