Skip to content

Commit

Permalink
feat: generate higher quality SourceMaps (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra authored and evilebottnawi committed Jul 31, 2019
1 parent 45ddf2f commit 9d777f0
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -44,7 +44,7 @@
"schema-utils": "^1.0.0",
"serialize-javascript": "^1.7.0",
"source-map": "^0.6.1",
"terser": "^4.1.2",
"terser": "^4.0.0",
"webpack-sources": "^1.4.0",
"worker-farm": "^1.7.0"
},
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Expand Up @@ -299,7 +299,8 @@ class TerserPlugin {
file,
JSON.parse(map),
input,
inputSourceMap
inputSourceMap,
true
);
} else {
outputSource = new RawSource(code);
Expand Down
6 changes: 2 additions & 4 deletions src/minify.js
Expand Up @@ -158,11 +158,9 @@ const minify = (options) => {
// Copy terser options
const terserOptions = buildTerserOptions(options.terserOptions);

// Add source map data
// Let terser generate a SourceMap
if (inputSourceMap) {
terserOptions.sourceMap = {
content: inputSourceMap,
};
terserOptions.sourceMap = true;
}

const extractedComments = [];
Expand Down

0 comments on commit 9d777f0

Please sign in to comment.