Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gruntjs/grunt-contrib-uglify
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.9.2
Choose a base ref
...
head repository: gruntjs/grunt-contrib-uglify
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.10.0
Choose a head ref
  • 10 commits
  • 22 files changed
  • 4 contributors

Commits on Jun 15, 2015

  1. I guess its the parent unglify JS should handle the preserve comments…

    … logic
    SamvelRaja.S committed Jun 15, 2015
    Copy the full SHA
    3a5ae12 View commit details

Commits on Sep 11, 2015

  1. CI: test node.js 4.0.

    XhmikosR committed Sep 11, 2015
    Copy the full SHA
    cef1526 View commit details

Commits on Sep 19, 2015

  1. Fix typo in README.md.

    Closes #353.
    
    [ci skip]
    XhmikosR committed Sep 19, 2015
    Copy the full SHA
    8a84b3a View commit details

Commits on Sep 23, 2015

  1. Merge pull request #338 from SamvelRaja/patch_preservecomments_passover

    I guess its the parent unglify JS should handle the preserve comments…
    vladikoff committed Sep 23, 2015
    Copy the full SHA
    9e6ed4f View commit details

Commits on Oct 11, 2015

  1. Update appveyor.yml.

    XhmikosR committed Oct 11, 2015
    Copy the full SHA
    985f065 View commit details
  2. Copy the full SHA
    cd12716 View commit details

Commits on Oct 14, 2015

  1. Update uglify-options.md

    [ci skip]
    XhmikosR committed Oct 14, 2015
    Copy the full SHA
    232b62b View commit details

Commits on Oct 24, 2015

  1. Update uri-path dependency

    The uri-path package is now dual-licensed under WTFPL and MIT.
    
    There are otherwise no functional changes from v0.0.2 to 1.0.0. I have bumped uri-path's version to 1.0.0 as it is already used in production and will follow semver.
    UltCombo committed Oct 24, 2015
    Copy the full SHA
    611feb6 View commit details
  2. Merge pull request #361 from UltCombo/patch-1

    Update uri-path dependency
    vladikoff committed Oct 24, 2015
    Copy the full SHA
    e47d9e1 View commit details

Commits on Oct 27, 2015

  1. v0.10.0

    vladikoff committed Oct 27, 2015
    Copy the full SHA
    b8bd228 View commit details
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sudo: false
language: node_js
node_js:
- 'iojs'
- '4'
- '0.12'
- '0.10'
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v0.10.0:
date: 2015-10-27
changes:
- bump to uglify ^2.5
v0.9.2:
date: 2015-08-24
changes:
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# grunt-contrib-uglify v0.9.2 [![Build Status: Linux](https://travis-ci.org/gruntjs/grunt-contrib-uglify.svg?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-uglify) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/ybtf5vbvtenii561/branch/master?svg=true)](https://ci.appveyor.com/project/gruntjs/grunt-contrib-uglify/branch/master)
# grunt-contrib-uglify v0.10.0 [![Build Status: Linux](https://travis-ci.org/gruntjs/grunt-contrib-uglify.svg?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-uglify) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/ybtf5vbvtenii561/branch/master?svg=true)](https://ci.appveyor.com/project/gruntjs/grunt-contrib-uglify/branch/master)

> Minify files with UglifyJS
@@ -168,44 +168,44 @@ Turn on preservation of comments.

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

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

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

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

#### screwIE8
Type: `Boolean`
Default: false
Default: `false`

Pass this flag if you don't care about full compliance with Internet Explorer 6-8 quirks.

#### mangleProperties
Type: `Boolean`
Default: false
Default: `false`

Use this flag to turn on object property name mangling.

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

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

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

Use this with `mangleProperties` 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`
Default: empty 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.
@@ -334,7 +334,7 @@ Refer to the [UglifyJS SourceMap Documentation](http://lisperator.net/uglifyjs/c
#### Turn off console warnings

Specify `drop_console: true` as part of the `compress` options to discard calls to `console.*` functions.
This will supress warning messages in the console.
This will suppress warning messages in the console.

```js
// Project configuration.
@@ -511,6 +511,7 @@ grunt.initConfig({

## Release History

* 2015-10-27   v0.10.0   bump to uglify ^2.5
* 2015-08-24   v0.9.2   bump to uglify ^2.4.24
* 2015-04-07   v0.9.1   more fixes for mangle options
* 2015-04-07   v0.9.0   added hook into uglify's mangling functionality
@@ -542,4 +543,4 @@ grunt.initConfig({

Task submitted by ["Cowboy" Ben Alman](http://benalman.com)

*This file was generated on Mon Aug 24 2015 10:50:01.*
*This file was generated on Tue Oct 27 2015 10:41:14.*
13 changes: 3 additions & 10 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
# AppVeyor file
# http://www.appveyor.com/docs/appveyor-yml

# Build version format
version: "{build}"

clone_depth: 10

# Fix line endings on Windows
init:
- git config --global core.autocrlf true

# What combinations to test
environment:
matrix:
- nodejs_version: 1
- nodejs_version: 0.12
- nodejs_version: 0.10
- nodejs_version: "4"
- nodejs_version: "0.12"
- nodejs_version: "0.10"

install:
- ps: Install-Product node $env:nodejs_version
@@ -31,5 +25,4 @@ matrix:
fast_finish: true

cache:
- '%APPDATA%\npm-cache -> package.json' # npm cache
- 'node_modules -> package.json' # local npm modules
2 changes: 1 addition & 1 deletion docs/uglify-examples.md
Original file line number Diff line number Diff line change
@@ -111,7 +111,7 @@ Refer to the [UglifyJS SourceMap Documentation](http://lisperator.net/uglifyjs/c
## Turn off console warnings

Specify `drop_console: true` as part of the `compress` options to discard calls to `console.*` functions.
This will supress warning messages in the console.
This will suppress warning messages in the console.

```js
// Project configuration.
14 changes: 7 additions & 7 deletions docs/uglify-options.md
Original file line number Diff line number Diff line change
@@ -118,44 +118,44 @@ Turn on preservation of comments.

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

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

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

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

## screwIE8
Type: `Boolean`
Default: false
Default: `false`

Pass this flag if you don't care about full compliance with Internet Explorer 6-8 quirks.

## mangleProperties
Type: `Boolean`
Default: false
Default: `false`

Use this flag to turn on object property name mangling.

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

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

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

Use this with `mangleProperties` 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`
Default: empty 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.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "grunt-contrib-uglify",
"description": "Minify files with UglifyJS",
"version": "0.9.2",
"version": "0.10.0",
"author": {
"name": "Grunt Team",
"url": "http://gruntjs.com/"
@@ -18,8 +18,8 @@
"chalk": "^1.0.0",
"lodash": "^3.2.0",
"maxmin": "^1.0.0",
"uglify-js": "^2.4.24",
"uri-path": "0.0.2"
"uglify-js": "^2.5.0",
"uri-path": "^1.0.0"
},
"devDependencies": {
"grunt": "^0.4.2",
19 changes: 4 additions & 15 deletions tasks/lib/uglify.js
Original file line number Diff line number Diff line change
@@ -197,21 +197,6 @@ exports.init = function(grunt) {
source_map: null
};

if (options.preserveComments) {
if (options.preserveComments === 'all' || options.preserveComments === true) {

// preserve all the comments we can
outputOptions.comments = true;
} else if (options.preserveComments === 'some') {
// preserve comments with directives or that start with a bang (!)
outputOptions.comments = /^!|@preserve|@license|@cc_on/i;
} else if (_.isFunction(options.preserveComments)) {

// support custom functions passed in
outputOptions.comments = options.preserveComments;
}
}

if (options.banner && options.sourceMap) {
outputOptions.preamble = options.banner;
}
@@ -269,6 +254,10 @@ exports.init = function(grunt) {
outputOptions.quote_style = options.quoteStyle;
}

if (!_.isUndefined(options.preserveComments)) {
outputOptions.comments = options.preserveComments;
}

return outputOptions;
};

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

2 changes: 1 addition & 1 deletion test/fixtures/expected/exportAll.js

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

2 changes: 1 addition & 1 deletion test/fixtures/expected/source_map_custom_name
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":3,"file":"sourcemap_customName.js","sources":["../test/fixtures/src/simple.js"],"names":["longFunctionC","argumentC","argumentD","longNameA","longNameB","result"],"mappings":"AAOA,QAASA,eAAcC,EAAUC,GAC/B,MAAOC,WAAYC,UAAYH,EAAYC,EAL7C,GAAIC,WAAY,EAEZC,UAAY,EAMZC,OAASL,cAAc,EAAE"}
{"version":3,"sources":["../test/fixtures/src/simple.js"],"names":["longFunctionC","argumentC","argumentD","longNameA","longNameB","result"],"mappings":"AAOA,QAASA,eAAcC,EAAUC,GAC/B,MAAOC,WAAYC,UAAYH,EAAYC,EAL7C,GAAIC,WAAY,EAEZC,UAAY,EAMZC,OAASL,cAAc,EAAE","file":"sourcemap_customName.js"}
2 changes: 1 addition & 1 deletion test/fixtures/expected/sourcemap_basic.js.map

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

2 changes: 1 addition & 1 deletion test/fixtures/expected/sourcemap_customRoot.js.map

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

2 changes: 1 addition & 1 deletion test/fixtures/expected/sourcemap_functionName.js.fn.map

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

2 changes: 1 addition & 1 deletion test/fixtures/expected/sourcemap_sources.js.map

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

2 changes: 1 addition & 1 deletion test/fixtures/expected/sourcemapin.js.map

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

Loading