We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 233fb26 commit aaec7b7Copy full SHA for aaec7b7
1 file changed
lib/previous-map.js
@@ -30,7 +30,7 @@ class PreviousMap {
30
31
consumer() {
32
if (!this.consumerCache) {
33
- this.consumerCache = new SourceMapConsumer(this.text)
+ this.consumerCache = new SourceMapConsumer(this.json ?? this.text)
34
}
35
return this.consumerCache
36
@@ -124,7 +124,15 @@ class PreviousMap {
124
} else if (this.annotation) {
125
let map = this.annotation
126
if (file) map = join(dirname(file), map)
127
- return this.loadFile(map)
+ let unknown = this.loadFile(map)
128
+ if (unknown) {
129
+ try {
130
+ this.json = JSON.parse(unknown.replace(/^\)]}'[^\n]*\n/, ''))
131
+ } catch (e) {
132
+ return undefined
133
+ }
134
135
+ return unknown
136
137
138
0 commit comments