terser 4.1.4 → 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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
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
+
3
12
  ## v4.1.4
4
13
 
5
14
  - Fixed a crash when inlining a function into somewhere else when it has interdependent, non-removable variables.
package/README.md CHANGED
@@ -1,7 +1,11 @@
1
1
  terser
2
2
  ======
3
3
 
4
- ![Terser](https://raw.githubusercontent.com/terser-js/terser/master/logo.png)
4
+ ![Terser](https://raw.githubusercontent.com/terser-js/terser/master/logo.svg)
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
- [![Build Status](https://travis-ci.org/terser-js/terser.svg?branch=master)](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
@@ -294,7 +294,7 @@ function run() {
294
294
  }).ast.to_mozilla_ast(), null, 2));
295
295
  } else if (program.output) {
296
296
  fs.writeFileSync(program.output, result.code);
297
- if (result.map) {
297
+ if (options.sourceMap.url !== "inline" && result.map) {
298
298
  fs.writeFileSync(program.output + ".map", result.map);
299
299
  }
300
300
  } else {