UNPKG
rollup-plugin-terser
Version:
latest (7.0.2)
7.0.2
7.0.1
7.0.0
6.1.0
6.0.1
6.0.0
5.3.1
5.3.0
5.2.0
5.1.3
5.1.2
5.1.1
5.1.0
5.0.0
4.0.4
4.0.3
4.0.2
4.0.1
4.0.0
3.0.0
2.0.2
2.0.1
2.0.0
1.0.1
1.0.0
Rollup plugin to minify generated es bundle
TrySound/rollup-plugin-terser
rollup-plugin-terser
/
transform.js
9 lines
(6 loc)
•
256 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
const
{ minify } =
require
(
"terser"
);
const
transform
= (
code, optionsString
) => {
const
options =
eval
(
`(
${optionsString}
)`
);
return
minify
(code, options).
then
(
result
=>
({ result,
nameCache
: options.
nameCache
})); };
exports
.
transform
= transform;