@@ -10,10 +10,7 @@ import MagicString, {SourceMap, type SourceMapOptions} from 'magic-string';
1010import type { ExpressionPrinter , PrintedSnippet } from './output_ast_printer.js' ;
1111
1212/** Options for `OutputSourceMapBuilder.generateMap`, a subset of MagicString's. */
13- export type OutputSourceMapOptions = Pick <
14- SourceMapOptions ,
15- 'file' | 'source' | 'includeContent' | 'hires'
16- > ;
13+ export type OutputSourceMapOptions = Pick < SourceMapOptions , 'file' | 'source' | 'includeContent' > ;
1714
1815/** A piece of compiled text spliced into the output, with the printed snippets it contains. */
1916interface Insertion {
@@ -58,9 +55,11 @@ export class OutputSourceMapBuilder {
5855 generateMap ( options : OutputSourceMapOptions = { } ) : SourceMap {
5956 const output = this . s . toString ( ) ;
6057 const sourceName = options . source ?? this . filePath ;
61- // A high-resolution map has a segment for every character of the original text, so a
62- // position in the output can be resolved exactly rather than relative to a line start.
63- const decoded = this . s . generateDecodedMap ( { ...options , hires : options . hires ?? true } ) ;
58+ const decoded = this . s . generateDecodedMap ( {
59+ ...options ,
60+ // Disable high resolution source maps, because they use a lot of memory.
61+ hires : 'boundary' ,
62+ } ) ;
6463 const sources = [ ...decoded . sources ] ;
6564 const sourcesContent : Array < string | null > | undefined =
6665 decoded . sourcesContent === undefined ? undefined : [ ...decoded . sourcesContent ] ;
0 commit comments