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

only add loader to NODE_OPTIONS if not already in argv #4

Open
isaacs opened this issue Feb 9, 2024 · 0 comments
Open

only add loader to NODE_OPTIONS if not already in argv #4

isaacs opened this issue Feb 9, 2024 · 0 comments

Comments

@isaacs
Copy link
Member

isaacs commented Feb 9, 2024

In cases where processinfo is used along with a transpiling loader with a load hook returning { source, format, shortCircuit: true }, then the @tapjs/processinfo loader must come last in the argument list, so that it can call nextLoad and record based on the result.

However, if the processinfo loader is in NODE_OPTIONS, then it will be first in the list, making it so that it never gets called in the load hook chain, and the file is not recorded.

The solution: only add the pi loader to NODE_OPTIONS env if it is not already present in argv.

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

1 participant