Skip to main content
The Deno 2 Release Candidate is here
Learn more
Latest
method SourceMapGenerator.prototype.applySourceMap
import { SourceMapGenerator } from "https://deno.land/x/source_map@0.8.0-beta.1/source-map.d.ts";

Applies the mappings of a sub-source-map for a specific source file to the source map being generated. Each mapping to the supplied source file is rewritten using the supplied source map. Note: The resolution for the resulting mappings is the minimium of this map and the supplied map.

Parameters

sourceMapConsumer: SourceMapConsumer

The source map to be applied.

optional
sourceFile: string

Optional. The filename of the source file. If omitted, SourceMapConsumer's file property will be used.

optional
sourceMapPath: string

Optional. The dirname of the path to the source map to be applied. If relative, it is relative to the SourceMapConsumer. This parameter is needed when the two source maps aren't in the same directory, and the source map to be applied contains relative source paths. If so, those relative source paths need to be rewritten relative to the SourceMapGenerator.