-
-
Notifications
You must be signed in to change notification settings - Fork 37.1k
add api to detect whether source-maps are enabled #46304
Copy link
Copy link
Closed
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
Description
Activity
Metadata
Metadata
Assignees
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
What is the problem this feature will solve?
#39085 added
process.setSourceMapsEnabledto 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.getSourceMapsEnabledthat returns whether the source-maps are enabled.What alternatives have you considered?
Add a getter + setter named
process.isSourceMapsEnabledthat works likeprocess.getSourceMapsEnabledandprocess.setSourceMapsEnabled.