You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
generateMap is not affected by any changes made to the value in the magic string.
importMagicStringfrom'magic-string'consts=newMagicString('problems = 99')s.update(0,8,'answer')console.log(s.toString())// 'answer = 99's.update(11,13,'42')// character indices always refer to the original stringconsole.log(s.toString())// 'answer = 42's.prepend('var ').append(';')// most methods are chainableconsole.log(s.toString())// 'var answer = 42;'constmap=s.generateMap({source: 'source.js',file: 'converted.js.map',includeContent: true})// generates a v3 sourcemapconsole.log(map.toString())
For those, who is still looking for the answer to this issue. This behaviour is intended and seems correct, as long as a sourcemap is a document, helping developers to map one statement in source code to another in the generated one.
So, if this (generateMap) function would return a generated code, you wouldn't know what was the source one.
"magic-string": "^0.30.5",
generateMap
is not affected by any changes made to the value in the magic string.Results in:
The text was updated successfully, but these errors were encountered: