Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add transform options to transform content #94

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

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