terser 4.1.1 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of terser might be problematic. Click here for more details.
- package/CHANGELOG.md +23 -1
- package/README.md +16 -3
- package/bin/uglifyjs +2 -5
- package/dist/bundle.min.js +2 -1
- package/dist/bundle.min.js.map +1 -1
- package/package.json +12 -8
- package/tools/domprops.js +2 -0
- package/tools/terser.d.ts +1 -1
- package/bin/uglifyjsnobundle +0 -4
- package/dist/bundle.js +0 -21998
- package/dist/bundle.js.map +0 -1
package/CHANGELOG.md
CHANGED
@@ -1,6 +1,28 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## v4.0
|
3
|
+
## v4.2.0
|
4
|
+
|
5
|
+
- When the source map URL is `inline`, don't write it to a file.
|
6
|
+
- Fixed output parens when a lambda literal is the tag on a tagged template string.
|
7
|
+
- The `mangle.properties.undeclared` option was added. This enables the property mangler to mangle properties of variables which can be found in the name cache, but whose properties are not known to this Terser run.
|
8
|
+
- The v8 bug where the toString and source representations of regexes like `RegExp("\\\n")` includes an actual newline is now fixed.
|
9
|
+
- Now we're guaranteed to not have duplicate comments in the output
|
10
|
+
- Domprops updates
|
11
|
+
|
12
|
+
## v4.1.4
|
13
|
+
|
14
|
+
- Fixed a crash when inlining a function into somewhere else when it has interdependent, non-removable variables.
|
15
|
+
|
16
|
+
## v4.1.3
|
17
|
+
|
18
|
+
- Several issues with the `reduce_vars` option were fixed.
|
19
|
+
- Starting this version, we only have a dist/bundle.min.js
|
20
|
+
|
21
|
+
## v4.1.2
|
22
|
+
|
23
|
+
- The hotfix was hotfixed
|
24
|
+
|
25
|
+
## v4.1.1
|
4
26
|
|
5
27
|
- Fixed a bug where toplevel scopes were being mixed up with lambda scopes
|
6
28
|
|
package/README.md
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
terser
|
2
2
|
======
|
3
3
|
|
4
|
-

|
5
|
+
|
6
|
+
[![NPM Version][npm-image]][npm-url]
|
7
|
+
[![NPM Downloads][downloads-image]][downloads-url]
|
8
|
+
[![Linux Build][travis-image]][travis-url]
|
5
9
|
|
6
10
|
A JavaScript parser and mangler/compressor toolkit for ES6+.
|
7
11
|
|
@@ -11,12 +15,16 @@ Terser recommends you use RollupJS to bundle your modules, as that produces smal
|
|
11
15
|
|
12
16
|
*Beautification* has been undocumented and is *being removed* from terser, we recommend you use [prettier](https://npmjs.com/package/prettier).
|
13
17
|
|
14
|
-
[](https://travis-ci.org/terser-js/terser)
|
15
|
-
|
16
18
|
Find the changelog in [CHANGELOG.md](https://github.com/terser-js/terser/blob/master/CHANGELOG.md)
|
17
19
|
|
18
20
|
A JavaScript parser, mangler/compressor and beautifier toolkit for ES6+.
|
19
21
|
|
22
|
+
[npm-image]: https://img.shields.io/npm/v/terser.svg
|
23
|
+
[npm-url]: https://npmjs.org/package/terser
|
24
|
+
[downloads-image]: https://img.shields.io/npm/dm/terser.svg
|
25
|
+
[downloads-url]: https://npmjs.org/package/terser
|
26
|
+
[travis-image]: https://img.shields.io/travis/terser-js/terser/master.svg
|
27
|
+
[travis-url]: https://travis-ci.org/terser-js/terser
|
20
28
|
|
21
29
|
Why choose terser?
|
22
30
|
------------------
|
@@ -948,6 +956,11 @@ Terser.minify(code, { mangle: { toplevel: true } }).code;
|
|
948
956
|
- `reserved` (default: `[]`) — Do not mangle property names listed in the
|
949
957
|
`reserved` array.
|
950
958
|
|
959
|
+
- `undeclared` (default: `false`) - Mangle those names when they are accessed
|
960
|
+
as properties of known top level variables but their declarations are never
|
961
|
+
found in input code. May be useful when only minifying parts of a project.
|
962
|
+
See [#397](https://github.com/terser-js/terser/issues/397) for more details.
|
963
|
+
|
951
964
|
## Output options
|
952
965
|
|
953
966
|
The code generator tries to output shortest code possible by default. In
|
package/bin/uglifyjs
CHANGED
@@ -11,10 +11,7 @@ var info = require("../package.json");
|
|
11
11
|
var path = require("path");
|
12
12
|
var program = require("commander");
|
13
13
|
|
14
|
-
var
|
15
|
-
"/../dist/bundle.js" :
|
16
|
-
"/../dist/bundle.min.js");
|
17
|
-
var UglifyJS = require(bundle_path);
|
14
|
+
var UglifyJS = require("..");
|
18
15
|
try {
|
19
16
|
require("source-map-support").install();
|
20
17
|
} catch (err) {}
|
@@ -297,7 +294,7 @@ function run() {
|
|
297
294
|
}).ast.to_mozilla_ast(), null, 2));
|
298
295
|
} else if (program.output) {
|
299
296
|
fs.writeFileSync(program.output, result.code);
|
300
|
-
if (result.map) {
|
297
|
+
if (options.sourceMap.url !== "inline" && result.map) {
|
301
298
|
fs.writeFileSync(program.output + ".map", result.map);
|
302
299
|
}
|
303
300
|
} else {
|