You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The exclusions (--include/--exclude) for the recently introduced --all feature are applied to the executable script paths rather than the source script paths. So when working with compiled code the user needs to know the filepaths of the generated code. This is awkward for users of systems like ours that perform filepath mangling during compilation.
I'd like to propose that c8 should match the nyc behavior. As this would be a breaking change, I guess we should introduce it behind a similar opt-in flag (--exclude-after-remap).
If you are happy with the suggestion, I'll work with @j03m to prepare a PR tomorrow.
@bcoe I was thinking that here: https://github.com/bcoe/c8/blob/master/lib/report.js#L153 since we will already have the source map url in hand, the most simple approach would be to extract the source file and supply it to shouldInstrument instead of the executable file from the v8 json blob.
From there, I think the call to globSync for --all could then be simplified to supply the source file itself. This would in theory lose the fileio required to fake the sourcemap cache.
Activity
j03m commentedon May 18, 2020
@bcoe I was thinking that here: https://github.com/bcoe/c8/blob/master/lib/report.js#L153 since we will already have the source map url in hand, the most simple approach would be to extract the source file and supply it to
shouldInstrumentinstead of the executable file from the v8 json blob.From there, I think the call to
globSyncfor--allcould then be simplified to supply the source file itself. This would in theory lose the fileio required to fake the sourcemap cache.Any thoughts?
bcoe commentedon May 21, 2020
@j03m this approach sounds smart to me, but would we only get this optimization if we were to make
--exclude-after-remapthe default behavior?@robpalme I think that this would be a good configuration option to add.
feat: introduce --exclude-after-remap flag
feat: introduce --exclude-after-remap flag (#293)
chore(release): 1.0.0 [skip ci]
chore(release): 1.0.0 [skip ci]
feat: introduce --exclude-after-remap flag (bcoe#293)