@serwist/build
Version:
A module that integrates into your build process, helping you generate a manifest of local files that should be precached.
42 lines • 1.26 kB
TypeScript
import type { RawSourceMap } from "source-map";
interface ReplaceAndUpdateSourceMapOptions {
/**
* The name for the file whose contents
* correspond to originalSource.
*/
jsFilename: string;
/**
* The sourcemap for originalSource,
* prior to any replacements.
*/
originalMap: RawSourceMap;
/**
* The source code, prior to any
* replacements.
*/
originalSource: string;
/**
* A string to swap in for searchString.
*/
replaceString: string;
/**
* A string in originalSource to replace.
* Only the first occurrence will be replaced.
*/
searchString: string;
}
/**
* Adapted from https://github.com/nsams/sourcemap-aware-replace, with modern
* JavaScript updates, along with additional properties copied from originalMap.
*
* @param options
* @returns An object containing both
* originalSource with the replacement applied, and the modified originalMap.
* @private
*/
export declare function replaceAndUpdateSourceMap({ jsFilename, originalMap, originalSource, replaceString, searchString, }: ReplaceAndUpdateSourceMapOptions): Promise<{
map: string;
source: string;
}>;
export {};
//# sourceMappingURL=replace-and-update-source-map.d.ts.map