Skip to content

add api to detect whether source-maps are enabled #46304

Description

@sapphi-red

What is the problem this feature will solve?

#39085 added process.setSourceMapsEnabled to enable source-maps programmatically. This is helpful for tools like Vite, thank you for implementing. 💚

But as this was implemented we now cannot know whether source-maps are enabled. I guess it was possible by process.execArgv.includes('--enable-source-maps') previously.

What is the feature you are proposing to solve the problem?

Add process.getSourceMapsEnabled that returns whether the source-maps are enabled.

What alternatives have you considered?

Add a getter + setter named process.isSourceMapsEnabled that works like process.getSourceMapsEnabled and process.setSourceMapsEnabled.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues requesting new Node.js features.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions