← All recipes
Moderne licensed

Migrate source-map-support to Node.js native source maps

Recipe IDorg.openrewrite.node.migrate.source-map-support.migrate-source-map-support-to-nativeArtifact@openrewrite/recipes-nodejs

Replaces the source-map-support package with Node.js's built-in source map support. Where Node is launched from package.json scripts or mocha/ava configuration, source-map-support/register becomes the --enable-source-maps flag; in code, install() and register imports become process.setSourceMapsEnabled(true). Uses with no native equivalent (custom retrieveSourceMap, browser bundles, webpack banners) are left in place, and the dependency is removed from each package.json that no longer needs it. Everything left in place is recorded in the SourceMapSupportManualMigrationSteps data table with a suggested replacement.

Composite recipesource-map-supportProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.node.migrate.source-map-support.migrate-source-map-support-to-native

If the recipe isn’t available locally, install it with:

mod config recipes npm install @openrewrite/recipes-nodejs

Definition

This recipe runs the following recipes in order.