sindresorhus/import-fresh

Transparent module.parent #5

mightyiam posted onGitHub

module.parent in module required by requireUncached will be the [...]/require-uncached/index.js module.

Can we please fix it to be the parent of that? Meaning, the module.parent.parent? I think it makes sense.


👍 Pull request welcome :)


Note: This issue has a bounty, so it's expected that you are an experienced programmer and that you give it your best effort if you intend to tackle this. Don't forget, if applicable, to add tests, docs (double-check for typos), and update TypeScript definitions. And don't be sloppy. Review your own diff multiple times and try to find ways to improve and simplify your code. Instead of asking too many questions, present solutions. The point of an issue bounty is to reduce my workload, not give me more. Include a 🦄 in your PR description to indicate that you've read this. Thanks for helping out 🙌 - @sindresorhus

posted by sindresorhus over 8 years ago

Does anyone have a pointer for me?

posted by mightyiam over 8 years ago

I think you could use Module._load (what require() uses) with a custom module entry to be able to set the parent. Another possible solution could be to modify require.cache.

posted by sindresorhus over 8 years ago

@issuehunt has funded $80.00 to this issue.


posted by issuehunt-app[bot] almost 6 years ago

@sindresorhus has rewarded $72.00 to @stroncium. See it on IssueHunt

  • :moneybag: Total deposit: $80.00
  • :tada: Repository reward(0%): $0.00
  • :wrench: Service fee(10%): $8.00
posted by issuehunt-app[bot] over 5 years ago

Fund this Issue

$80.00
Rewarded

Rewarded pull request

Recent activities

stroncium was rewarded by sindresorhus for sindresorhus/import-fresh# 5
over 5 years ago
stroncium submitted an output to  sindresorhus/ import-fresh# 5
almost 6 years ago