File tree 3 files changed +9
-10
lines changed
3 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,6 @@ function createCodegenContext(
227
227
// lazy require source-map implementation, only in non-browser builds
228
228
context . map = new SourceMapGenerator ( )
229
229
context . map . setSourceContent ( filename , context . source )
230
- // @ts -ignore
231
230
context . map . _sources . add ( filename )
232
231
}
233
232
Original file line number Diff line number Diff line change @@ -339,22 +339,21 @@ function generateSourceMap(
339
339
sourceRoot : sourceRoot . replace ( / \\ / g, '/' )
340
340
} )
341
341
map . setSourceContent ( filename , source )
342
+ map . _sources . add ( filename )
342
343
generated . split ( splitRE ) . forEach ( ( line , index ) => {
343
344
if ( ! emptyRE . test ( line ) ) {
344
345
const originalLine = index + 1 + lineOffset
345
346
const generatedLine = index + 1
346
347
for ( let i = 0 ; i < line . length ; i ++ ) {
347
348
if ( ! / \s / . test ( line [ i ] ) ) {
348
- map . addMapping ( {
349
+ map . _mappings . add ( {
350
+ originalLine,
351
+ originalColumn : i ,
352
+ generatedLine,
353
+ generatedColumn : i ,
349
354
source : filename ,
350
- original : {
351
- line : originalLine ,
352
- column : i
353
- } ,
354
- generated : {
355
- line : generatedLine ,
356
- column : i
357
- }
355
+ // @ts -ignore
356
+ name : null
358
357
} )
359
358
}
360
359
}
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ declare module 'source-map-js' {
48
48
export interface SourceMapGenerator {
49
49
// SourceMapGenerator has this method but the types do not include it
50
50
toJSON ( ) : RawSourceMap
51
+ _sources : Set < string >
51
52
_names : Set < string >
52
53
_mappings : {
53
54
add ( mapping : MappingItem ) : void
You can’t perform that action at this time.
0 commit comments