Proposal: allow bundle content retrieval to be customized in parseBundle
#217
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm looking to use some parts of this project in a scenario where it's easiest to retrieve bundle files from a CDN rather than from the file system itself. I could download from the CDN to a temporary location, but by abstracting the
fs
calls to a “bundle host” object, I can feed the function a string from memory rather than relying on the file system itself. It would be even nicer if this function were async, and I could just tell the bundleHost tofetch()
from the CDN, but I figured adding that complexity wouldn’t be warranted here.At the moment, I only need
parseBundle
, and so only made changes there, but this approach could be used throughout the project, and I'd be open to making those changes if that would make this PR seem more appealing.Thoughts? Thanks for this project and for the consideration!