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: Accept function for the clear option. #4

Merged
merged 1 commit into from
Feb 19, 2019
Merged

feat: Accept function for the clear option. #4

merged 1 commit into from
Feb 19, 2019

Conversation

coreyfarrell
Copy link
Contributor

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 importing src/index.js which imports a bunch of other sources. You copy src/index.html to build/index.html, but build/index.js is the bundle, not the source. All other files which became part of the bundle are copied to the appropriate place within build/ so browsers can find them via sourceMap.sources, but src/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.

This allows conditional removal of sourcesContent entries based on
associated filename.
@phated
Copy link
Contributor

phated commented Feb 19, 2019

This looks great. Thanks @coreyfarrell

@phated phated merged commit 812a8eb into gulp-sourcemaps:master Feb 19, 2019
@phated
Copy link
Contributor

phated commented Feb 19, 2019

Published as 1.1.0

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.

2 participants