feat: Accept function for the clear
option.
#4
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.
This allows conditional removal of sourcesContent entries based on
associated filename.
This is useful for bundles created for web pages. It can be desirable for the entry-point to be the same filename before/after bundling. So you have
src/index.html
importingsrc/index.js
which imports a bunch of other sources. You copysrc/index.html
tobuild/index.html
, butbuild/index.js
is the bundle, not the source. All other files which became part of the bundle are copied to the appropriate place withinbuild/
so browsers can find them viasourceMap.sources
, butsrc/index.js
needs to be in the source map.Note for my own purposes a way to say "clear all sourcesContent which are not associated with sourceMap.file" would be good enough but I figured this callback would be more generic.