Skip to content

Commit 2a41681

Browse files
RedHatterTimothy Johnsonbenmccannlukeed
authored
fix: keep all sourcemaps from chunk (#44)
* Handle sourcemaps * fix: blame the github editor Co-authored-by: Timothy Johnson <[email protected]> Co-authored-by: Ben McCann <[email protected]> Co-authored-by: Luke Edwards <[email protected]>
1 parent 79fe265 commit 2a41681

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,15 @@ module.exports = function (options = {}) {
227227

228228
if (config.sourcemap && chunk.map) {
229229
const len = sources.length;
230-
sources.push(chunk.map.sources[0]);
231-
if (sourcesContent) sourcesContent.push(chunk.map.sourcesContent[0]);
230+
sources.push(...chunk.map.sources);
231+
if (sourcesContent) sourcesContent.push(...chunk.map.sourcesContent);
232232

233233
const decoded = decode(chunk.map.mappings);
234234

235235
if (len > 0) {
236236
decoded.forEach(line => {
237237
line.forEach(segment => {
238-
segment[1] = len;
238+
segment[1] += len;
239239
});
240240
});
241241
}

0 commit comments

Comments
 (0)