Skip to content

Commit b7c556c

Browse files
committed
Fix NoWorkResult and prev map
1 parent 90c9729 commit b7c556c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/map-generator.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ class MapGenerator {
186186
generateMap() {
187187
if (this.root) {
188188
this.generateString()
189+
} else if (this.previous().length === 1) {
190+
let prev = this.previous()[0].consumer()
191+
prev.file = this.outputFile()
192+
this.map = SourceMapGenerator.fromSourceMap(prev)
189193
} else {
190194
this.map = new SourceMapGenerator({ file: this.outputFile() })
191195
this.map.addMapping({
@@ -196,7 +200,7 @@ class MapGenerator {
196200
}
197201

198202
if (this.isSourcesContent()) this.setSourcesContent()
199-
if (this.previous().length > 0) this.applyPrevMaps()
203+
if (this.root && this.previous().length > 0) this.applyPrevMaps()
200204
if (this.isAnnotation()) this.addAnnotation()
201205

202206
if (this.isInline()) {

0 commit comments

Comments
 (0)