Skip to content
This repository was archived by the owner on Dec 5, 2019. It is now read-only.

Commit 75b0138

Browse files
author
evilebottnawi
committed
fix: source maps generation when use parallel option
1 parent 786b332 commit 75b0138

File tree

3 files changed

+810
-9
lines changed

3 files changed

+810
-9
lines changed

src/index.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,14 @@ class UglifyJsPlugin {
123123
let input;
124124
let inputSourceMap;
125125

126-
if (this.options.sourceMap) {
127-
if (asset.sourceAndMap) {
128-
const sourceAndMap = asset.sourceAndMap();
129-
inputSourceMap = sourceAndMap.map;
130-
input = sourceAndMap.source;
131-
} else {
132-
inputSourceMap = asset.map();
133-
input = asset.source();
134-
}
126+
if (this.options.sourceMap && asset.sourceAndMap) {
127+
const sourceAndMap = asset.sourceAndMap();
128+
input = sourceAndMap.source;
129+
inputSourceMap = sourceAndMap.map;
135130
sourceMap = new SourceMapConsumer(inputSourceMap);
136131
} else {
137132
input = asset.source();
133+
inputSourceMap = null;
138134
}
139135

140136
// Handling comment extraction

0 commit comments

Comments
 (0)