Skip to content

Conversation

wardpeet
Copy link

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.

@paulirish
Copy link
Contributor

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

@goto-bus-stop
Copy link
Member

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 goto-bus-stop self-requested a review May 25, 2020 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants