Skip to content

Commit 9d777f0

Browse files
sokraevilebottnawi
authored andcommitted
feat: generate higher quality SourceMaps (#109)
1 parent 45ddf2f commit 9d777f0

File tree

6 files changed

+137
-16
lines changed

6 files changed

+137
-16
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"schema-utils": "^1.0.0",
4545
"serialize-javascript": "^1.7.0",
4646
"source-map": "^0.6.1",
47-
"terser": "^4.1.2",
47+
"terser": "^4.0.0",
4848
"webpack-sources": "^1.4.0",
4949
"worker-farm": "^1.7.0"
5050
},

src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,8 @@ class TerserPlugin {
299299
file,
300300
JSON.parse(map),
301301
input,
302-
inputSourceMap
302+
inputSourceMap,
303+
true
303304
);
304305
} else {
305306
outputSource = new RawSource(code);

src/minify.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,9 @@ const minify = (options) => {
158158
// Copy terser options
159159
const terserOptions = buildTerserOptions(options.terserOptions);
160160

161-
// Add source map data
161+
// Let terser generate a SourceMap
162162
if (inputSourceMap) {
163-
terserOptions.sourceMap = {
164-
content: inputSourceMap,
165-
};
163+
terserOptions.sourceMap = true;
166164
}
167165

168166
const extractedComments = [];

0 commit comments

Comments
 (0)