Skip to content

Commit

Permalink
Fix JavaScript source maps
Browse files Browse the repository at this point in the history
Closes #114
  • Loading branch information
valtlai committed Jun 23, 2021
1 parent 3ce6cb5 commit ddcef29
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions plugins/terser.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@ export default function (userOptions = {}) {
if (options.sourceMap) {
terserOptions.sourceMap = {
filename,
// Filename is path, so just need basename
url: basename(filename) + ".map",
};
}

try {
const output = await minify(content, terserOptions);
const output = await minify({ [filename]: content }, terserOptions);
file.content = output.code;

if (output.map) {
Expand Down

0 comments on commit ddcef29

Please sign in to comment.