Skip to content

Commit

Permalink
Update uglify-js to v3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlamsl committed Nov 25, 2017
1 parent 5251b6f commit 602ced4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 27 deletions.
49 changes: 25 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,94 +51,94 @@ sourceMapUrl | sourceMap.url


#### mangle
Type: `Boolean` `Object`

This comment has been minimized.

Copy link
@XhmikosR

XhmikosR Nov 26, 2017

Member

@alexlamsl The spaces are needed. Also, you are not supposed to edit README.md manually; you run grunt after you bump the version

Type: `Boolean` `Object`
Default: `{}`

Turn on or off mangling with default options. If an `Object` is specified, it is passed directly to `ast.mangle_names()` *and* `ast.compute_char_frequency()` (mimicking command line behavior). [View all options here](https://github.com/mishoo/UglifyJS2#mangler-options).

#### compress
Type: `Boolean` `Object`
Type: `Boolean` `Object`
Default: `{}`

Turn on or off source compression with default options. If an `Object` is specified, it is passed as options to `UglifyJS.Compressor()`. [View all options here](https://github.com/mishoo/UglifyJS2#compressor-options).

#### beautify
Type: `Boolean` `Object`
Type: `Boolean` `Object`
Default: `false`

Turns on beautification of the generated source code. [View all options here](https://github.com/mishoo/UglifyJS2#beautifier-options)

###### parse.expression
Type: `Boolean`
Type: `Boolean`
Default: `false`

Parse a single expression, rather than a program (for parsing JSON)

#### report
Type: `string`
Choices: `'min'`, `'gzip'`
Type: `string`
Choices: `'min'`, `'gzip'`
Default: `'min'`

Report minification result or both minification and gzip results.
This is useful to see exactly how well uglify-js is performing but using `'gzip'` will make the task take 5-10x longer to complete. [Example output](https://github.com/sindresorhus/maxmin#readme).

#### sourceMap
Type: `Boolean`
Type: `Boolean`
Default: `false`

If `true`, a source map file will be generated in the same directory as the `dest` file. By default it will have the same basename as the `dest` file, but with a `.map` extension.

#### sourceMapName
Type: `String` `Function`
Type: `String` `Function`
Default: `undefined`

To customize the name or location of the generated source map, pass a string to indicate where to write the source map to. If a function is provided, the uglify destination is passed as the argument and the return value will be used as the file name.

#### sourceMapIn
Type: `String` `Function`
Type: `String` `Function`
Default: `undefined`

The location of an input source map from an earlier compilation, e.g. from CoffeeScript. If a function is provided, the
uglify source is passed as the argument and the return value will be used as the sourceMap name. This only makes sense
when there's one source file.

#### sourceMap.includeSources
Type: `Boolean`
Type: `Boolean`
Default: `false`

Pass this flag if you want to include the content of source files in the source map as sourcesContent property.

###### sourceMap.root
Type: `String`
Type: `String`
Default: `undefined`

With this option you can customize root URL that browser will use when looking for sources.

If the sources are not absolute URLs after prepending of the `sourceMap.root`, the sources are resolved relative to the source map.

#### sourceMap.url
Type: `String`
Type: `String`
Default: `undefined`

Override the calculated value for `sourceMappingURL` in the source map. This is useful if the source map location is not relative to the base path of the minified file, i.e. when using a CDN

#### wrap
Type: `String`
Type: `String`
Default: `undefined`

Wrap all of the code in a closure, an easy way to make sure nothing is leaking.
For variables that need to be public `exports` and `global` variables are made available.
The value of wrap is the global variable exports will be available as.

#### output.ascii_only
Type: `Boolean`
Type: `Boolean`
Default: `false`

Enables to encode non-ASCII characters as \uXXXX.

#### output.comments
Type: `Boolean` `String` `Function`
Default: `undefined`
Type: `Boolean` `String` `Function`
Default: `undefined`
Options: `false` `'all'` `'some'`

Turn on preservation of comments.
Expand All @@ -150,51 +150,51 @@ Turn on preservation of comments.
- `RegExp` `'/[RegExp]/'` will preserve comments matching given RegExp or stringified RegExp

#### banner
Type: `String`
Type: `String`
Default: `''`

This string will be prepended to the minified output. Template strings (e.g. `<%= config.value %>` will be expanded automatically.

#### footer
Type: `String`
Type: `String`
Default: `''`

This string will be appended to the minified output. Template strings (e.g. `<%= config.value %>` will be expanded automatically.

#### ie8
Type: `Boolean`
Type: `Boolean`
Default: `false`

Set this to `true` if you still care about full compliance with Internet Explorer 6-8 quirks.

#### mangle.properties
Type: `Boolean` `Object`
Type: `Boolean` `Object`
Default: `false`

Turn on or off property mangling with default options. If an `Object` is specified, it is passed directly to `ast.mangle_properties()` (mimicking command line behavior). [View all options here](https://github.com/mishoo/UglifyJS2#mangler-options).

#### reserveDOMProperties
Type: `Boolean`
Type: `Boolean`
Default: `false`

Use this flag in conjunction with `mangle.properties` to prevent built-in browser object properties from being mangled.

#### exceptionsFiles
Type: `Array`
Type: `Array`
Default: `[]`

Use this with `mangle.properties` to pass one or more JSON files containing a list of variables and object properties
that should not be mangled. See the [UglifyJS docs](https://www.npmjs.com/package/uglify-js) for more info on the file syntax.

#### nameCache
Type: `String`
Type: `String`
Default: `''`

A string that is a path to a JSON cache file that uglify will create and use to coordinate symbol mangling between
multiple runs of uglify. Note: this generated file uses the same JSON format as the `exceptionsFiles` files.

#### output.quote_style
Type: `Integer`
Type: `Integer`
Default: `0`

Preserve or enforce quotation mark style.
Expand Down Expand Up @@ -525,6 +525,7 @@ grunt.initConfig({

## Release History

* 2017-11-26   v3.2.0   Update uglify-js to v3.2.0.
* 2017-09-11   v3.1.0   Update uglify-js to v3.1.0.
* 2017-05-20   v3.0.1   Fix toplevel option.
* 2017-05-12   v3.0.0   Update uglify-js to v3.0.4.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "grunt-contrib-uglify",
"description": "Minify JavaScript files with UglifyJS",
"version": "3.1.0",
"version": "3.2.0",
"author": {
"name": "Grunt Team",
"url": "http://gruntjs.com/"
Expand All @@ -18,7 +18,7 @@
"dependencies": {
"chalk": "^1.0.0",
"maxmin": "^1.1.0",
"uglify-js": "~3.1.0",
"uglify-js": "~3.2.0",
"uri-path": "^1.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/expected/quotes_original.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 comments on commit 602ced4

@XhmikosR
Copy link
Member

Choose a reason for hiding this comment

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

You also forgot the git tag.

@alexlamsl
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@XhmikosR sorry for the mess, and thanks for fixing it!

@XhmikosR
Copy link
Member

Choose a reason for hiding this comment

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

@alexlamsl: what I don't get is, did you force push the master branch? If so, you should never do it. In fact, @vladikoff please enable branch protection for the master branch.

@alexlamsl
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I made hiccup as I didn't test for Node.js 0.10

In the next iteration, I'll test it out properly via Pull Request.

@XhmikosR
Copy link
Member

@XhmikosR XhmikosR commented on 602ced4 Nov 26, 2017

Choose a reason for hiding this comment

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

I've sent a PR in grunt-contrib-internal to bump the major version due to the 0.10 removal.

But please, never force push. And you could just reset the branch to the old state or ping me to do it.

Now it's a mess. I had to recreate the tags/releases.

@alexlamsl
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@XhmikosR lesson learnt - no more -f

May I ask how to reset a branch?

@XhmikosR
Copy link
Member

Choose a reason for hiding this comment

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

You could use git reflog, find the hash, and git reset --hard to that. Again, this would need to be force pushed too, but it would be in order to fix the mess. If we have branch protection you cannot force push anyway so this wouldn't happen.

At any case, use PRs in the future, and CC me if you are not sure.

@alexlamsl
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the information.

What I did to master was:

$ git commit --amend
$ git push -f -u origin master

I didn't think it would alter any history other than the latest commit, but obviously that's not the case.

Sorry again for the mess.

@XhmikosR
Copy link
Member

Choose a reason for hiding this comment

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

Any change to a commit will change its hash. Be it the date, the commit message, anything.

If I had kept the repo locally, I would have fixed this, but unfortunately I hadn't kept it checked out.

Please sign in to comment.