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

Invalidate source-map-support cache when require.cache is cleaned and file is re-required #1503

Open
cspotcode opened this issue Oct 11, 2021 · 0 comments
Labels
you can do this Good candidate for a pull request.

Comments

@cspotcode
Copy link
Collaborator

cspotcode commented Oct 11, 2021

Invalidate source-map-support cache when require.cache is cleaned and file is re-required.

Fixes #268

Is emptyCacheBetweenOperations sufficient? Or will this cause unnecessary fs calls within source-map-support?

If we want to avoid a cache invalidation API in source-map-support, should we implement our own fs caching? It will call us because of empty cache every time, but we can implement caching and fs reads on our side.

Related to cspotcode/node-source-map-support#32

Maybe can use WeakMap to associate require.cache entry w/cached sourcemap. So that when require.cache is cleared, we automatically re-populate our own cache?

@cspotcode cspotcode added the you can do this Good candidate for a pull request. label Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
you can do this Good candidate for a pull request.
Projects
None yet
Development

No branches or pull requests

1 participant