Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Update Terser to 5.0.0 #82

Merged
merged 1 commit into from Aug 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions package.json
Expand Up @@ -32,18 +32,18 @@
"author": "Bogdan Chadkin <trysound@yandex.ru>",
"license": "MIT",
"dependencies": {
"@babel/code-frame": "^7.8.3",
"jest-worker": "^26.0.0",
"@babel/code-frame": "^7.10.4",
"jest-worker": "^26.2.1",
"serialize-javascript": "^3.0.0",
"terser": "^4.7.0"
"terser": "^5.0.0"
},
"peerDependencies": {
"rollup": "^2.0.0"
},
"devDependencies": {
"@babel/core": "^7.9.6",
"jest": "^26.0.1",
"@babel/core": "^7.11.0",
"jest": "^26.2.2",
"prettier": "^2.0.5",
"rollup": "^2.10.8"
"rollup": "^2.23.0"
}
}
6 changes: 6 additions & 0 deletions test/__snapshots__/test.js.snap
Expand Up @@ -8,11 +8,14 @@ Object {
"dynamicImports": Array [],
"exports": Array [],
"fileName": "chunk-1.js",
"implicitlyLoadedBefore": Array [],
Copy link
Contributor Author

@chicoxyzzy chicoxyzzy Aug 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"imports": Array [],
"isDynamicEntry": false,
"isEntry": true,
"isImplicitEntry": false,
Copy link
Contributor Author

@chicoxyzzy chicoxyzzy Aug 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from rollup 2.13.0 too

"map": null,
"name": "chunk-1",
"referencedFiles": Array [],
Copy link
Contributor Author

@chicoxyzzy chicoxyzzy Aug 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"type": "chunk",
},
"chunk-2.js": Object {
Expand All @@ -21,11 +24,14 @@ Object {
"dynamicImports": Array [],
"exports": Array [],
"fileName": "chunk-2.js",
"implicitlyLoadedBefore": Array [],
"imports": Array [],
"isDynamicEntry": false,
"isEntry": true,
"isImplicitEntry": false,
"map": null,
"name": "chunk-2",
"referencedFiles": Array [],
"type": "chunk",
},
}
Expand Down
7 changes: 1 addition & 6 deletions transform.js
Expand Up @@ -2,12 +2,7 @@ const { minify } = require("terser");

const transform = (code, optionsString) => {
const options = eval(`(${optionsString})`);
const result = minify(code, options);
if (result.error) {
throw result.error;
} else {
return { result, nameCache: options.nameCache };
}
return minify(code, options).then(result => ({ result, nameCache: options.nameCache }));
};

exports.transform = transform;