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

Expose export conditions #216

Closed
ghost opened this issue Jul 14, 2024 · 1 comment
Closed

Expose export conditions #216

ghost opened this issue Jul 14, 2024 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 14, 2024

My loader analyzes source to determine module shape. It uses the nextResolve and nextLoad routines to access the source. To ensure correct results from these routines, I pass export conditions to them. They're extracted by the resolve hook.

async function resolve (specifier, context, next) {
  // Retain export conditions for analysis
  state.conditions ??= [...context.conditions]
  ...

I think (?) export conditions are static across a run (modulo require vs import signaling which loader it's from).

It would be cleaner if there were some global access to these, so they don't need extracting.

function initialize (port, conditions) {
  state.conditions = conditions
  ...
@ghost
Copy link
Author

ghost commented Jul 14, 2024

Seems to be covered well by #205.

@ghost ghost closed this as completed Jul 14, 2024
This issue was closed.
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

No branches or pull requests

0 participants