Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.

Commit e2103a9

Browse files
committed
Flip conditional
1 parent cfa1c9b commit e2103a9

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/build-source-map-tree.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,16 @@ function build(
7171

7272
const { source, content } = ctx;
7373

74-
// If there is no sourcemap, then it is an unmodified source file.
75-
if (!sourceMap) {
76-
// The contents of this unmodified source file can be overridden via the loader context,
77-
// allowing it to be explicitly null or a string. If it remains undefined, we fall back to
78-
// the importing sourcemap's `sourcesContent` field.
79-
const sourceContent =
80-
content !== undefined ? content : sourcesContent ? sourcesContent[i] : null;
81-
return OriginalSource(source, sourceContent);
82-
}
74+
// If there is a sourcemap, then we need to recurse into it to load its source files.
75+
if (sourceMap) return build(new TraceMap(sourceMap, source), loader, source, depth);
8376

84-
// Else, it's a real sourcemap, and we need to recurse into it to load its
85-
// source files.
86-
return build(new TraceMap(sourceMap, source), loader, source, depth);
77+
// Else, it's an an unmodified source file.
78+
// The contents of this unmodified source file can be overridden via the loader context,
79+
// allowing it to be explicitly null or a string. If it remains undefined, we fall back to
80+
// the importing sourcemap's `sourcesContent` field.
81+
const sourceContent =
82+
content !== undefined ? content : sourcesContent ? sourcesContent[i] : null;
83+
return OriginalSource(source, sourceContent);
8784
});
8885

8986
return MapSource(map, children);

0 commit comments

Comments
 (0)