Skip to content

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

Open
@isaacs

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions