Skip to content

Unsable to merge 2 very simple source maps #6

@otakustay

Description

@otakustay

I have 2 source maps generated from magic-string:

{
  version: 3,
  file: null,
  sources: [ 'test' ],
  sourcesContent: [ 'hello' ],
  names: [],
  mappings: 'AAAA' 
}

{
  version: 3,
  file: null,
  sources: [ 'test' ],
  sourcesContent: [ 'hellosome tail string' ],
  names: [],
  mappings: 'AAAA'
}

The transform steps are hello -> hellosome tail string -> hellosome tail stringsome tail string, each step appends some tail string to original input

When I try to merge them, I get the result:

{
  version: 3,
  sources: [ 'test' ],
  names: [],
  mappings: 'AAAA',
  sourcesContent: [ 'hellosome tail string' ] 
}

This is actually the second source map, and with this map I'm unable to recover the original string hello

I'm wondering whether it is the expected behaiovr?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions