use older Nodejs module terser 4.x
This partly reverses upstream git commit 9f7cbad. Last-Update: 2020-12-13 Gbp-Pq: Name 2001_use_older_terser.patch
This commit is contained in:
parent
9e4b282b81
commit
9ff4c86228
|
@ -9,6 +9,7 @@ Object {
|
|||
"exports": Array [],
|
||||
"fileName": "chunk-1.js",
|
||||
"implicitlyLoadedBefore": Array [],
|
||||
"importedBindings": Object {},
|
||||
"imports": Array [],
|
||||
"isDynamicEntry": false,
|
||||
"isEntry": true,
|
||||
|
@ -25,6 +26,7 @@ Object {
|
|||
"exports": Array [],
|
||||
"fileName": "chunk-2.js",
|
||||
"implicitlyLoadedBefore": Array [],
|
||||
"importedBindings": Object {},
|
||||
"imports": Array [],
|
||||
"isDynamicEntry": false,
|
||||
"isEntry": true,
|
||||
|
|
|
@ -2,7 +2,12 @@ const { minify } = require("terser");
|
|||
|
||||
const transform = (code, optionsString) => {
|
||||
const options = eval(`(${optionsString})`);
|
||||
return minify(code, options).then(result => ({ result, nameCache: options.nameCache }));
|
||||
const result = minify(code, options);
|
||||
if (result.error) {
|
||||
throw result.error;
|
||||
} else {
|
||||
return { result, nameCache: options.nameCache };
|
||||
}
|
||||
};
|
||||
|
||||
exports.transform = transform;
|
||||
|
|
Loading…
Reference in New Issue