Skip to content

Commit 0f45e4e

Browse files
committed
v3.0.0.
1 parent ccd7ad0 commit 0f45e4e

File tree

3 files changed

+58
-56
lines changed

3 files changed

+58
-56
lines changed

CHANGELOG

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
v3.0.0:
2+
date: 2017-05-12
3+
changes:
4+
- Update uglify-js to v3.0.4.
15
v2.3.0:
26
date: 2017-04-05
37
changes:

README.md

+53-55
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# grunt-contrib-uglify v2.3.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)
1+
# grunt-contrib-uglify v3.0.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)
22

33
> Minify JavaScript files with UglifyJS
44
@@ -28,10 +28,26 @@ Task targets, files and options may be specified according to the grunt [Configu
2828

2929
### Options
3030

31-
This task primarily delegates to [UglifyJS2][], so please consider the [UglifyJS documentation][] as required reading for advanced configuration.
31+
This task primarily delegates to [UglifyJS](https://github.com/mishoo/UglifyJS2), so please consider their documentation as required reading for advanced configuration.
3232

33-
[UglifyJS2]: https://github.com/mishoo/UglifyJS2
34-
[UglifyJS documentation]: http://lisperator.net/uglifyjs/
33+
34+
###### Deprecated options from `2.x`
35+
36+
Option | Replacement
37+
----------------------- | -----------
38+
ASCIIOnly | output.ascii_only
39+
enclose | —
40+
exportAll | —
41+
expression | parse.expression
42+
indentLevel | output.indent_level
43+
mangleProperties | mangle.properties
44+
maxLineLen | output.max\_line_len
45+
preserveComments | output.comments
46+
quoteStyle | output.quote_style
47+
screwIE8 | !ie8
48+
sourceMapIncludeSources | sourceMap.includeSources
49+
sourceMapRoot | sourceMap.root
50+
sourceMapUrl | sourceMap.url
3551

3652

3753
#### mangle
@@ -50,9 +66,9 @@ Turn on or off source compression with default options. If an `Object` is specif
5066
Type: `Boolean` `Object`
5167
Default: `false`
5268

53-
Turns on beautification of the generated source code. An `Object` will be merged and passed with the options sent to `UglifyJS.OutputStream()`. [View all options here](https://github.com/mishoo/UglifyJS2#beautifier-options)
69+
Turns on beautification of the generated source code. [View all options here](https://github.com/mishoo/UglifyJS2#beautifier-options)
5470

55-
###### expression
71+
###### parse.expression
5672
Type: `Boolean`
5773
Default: `false`
5874

@@ -86,33 +102,26 @@ The location of an input source map from an earlier compilation, e.g. from Coffe
86102
uglify source is passed as the argument and the return value will be used as the sourceMap name. This only makes sense
87103
when there's one source file.
88104

89-
#### sourceMapIncludeSources
105+
#### sourceMap.includeSources
90106
Type: `Boolean`
91107
Default: `false`
92108

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

95-
###### sourceMapRoot
111+
###### sourceMap.root
96112
Type: `String`
97113
Default: `undefined`
98114

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

101-
If the sources are not absolute URLs after prepending of the `sourceMapRoot`, the sources are resolved relative to the source map.
117+
If the sources are not absolute URLs after prepending of the `sourceMap.root`, the sources are resolved relative to the source map.
102118

103-
#### sourceMapUrl
119+
#### sourceMap.url
104120
Type: `String`
105121
Default: `undefined`
106122

107123
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
108124

109-
###### enclose
110-
Type: `Object`
111-
Default: `undefined`
112-
113-
Wrap all of the code in a closure with a configurable arguments/parameters list.
114-
Each key-value pair in the `enclose` object is effectively an argument-parameter pair.
115-
116125
#### wrap
117126
Type: `String`
118127
Default: `undefined`
@@ -121,25 +130,13 @@ Wrap all of the code in a closure, an easy way to make sure nothing is leaking.
121130
For variables that need to be public `exports` and `global` variables are made available.
122131
The value of wrap is the global variable exports will be available as.
123132

124-
#### maxLineLen
125-
Type: `Number`
126-
Default: `32000`
127-
128-
Limit the line length in symbols. Pass maxLineLen = 0 to disable this safety feature.
129-
130-
#### ASCIIOnly
133+
#### output.ascii_only
131134
Type: `Boolean`
132135
Default: `false`
133136

134137
Enables to encode non-ASCII characters as \uXXXX.
135138

136-
#### exportAll
137-
Type: `Boolean`
138-
Default: `false`
139-
140-
When using `wrap` this will make all global functions and variables available via the export variable.
141-
142-
#### preserveComments
139+
#### output.comments
143140
Type: `Boolean` `String` `Function`
144141
Default: `undefined`
145142
Options: `false` `'all'` `'some'`
@@ -164,13 +161,13 @@ Default: `''`
164161

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

167-
#### screwIE8
164+
#### ie8
168165
Type: `Boolean`
169-
Default: `true`
166+
Default: `false`
170167

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

173-
#### mangleProperties
170+
#### mangle.properties
174171
Type: `Boolean` `Object`
175172
Default: `false`
176173

@@ -180,13 +177,13 @@ Turn on or off property mangling with default options. If an `Object` is specifi
180177
Type: `Boolean`
181178
Default: `false`
182179

183-
Use this flag in conjunction with `mangleProperties` to prevent built-in browser object properties from being mangled.
180+
Use this flag in conjunction with `mangle.properties` to prevent built-in browser object properties from being mangled.
184181

185182
#### exceptionsFiles
186183
Type: `Array`
187184
Default: `[]`
188185

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

192189
#### nameCache
@@ -196,7 +193,7 @@ Default: `''`
196193
A string that is a path to a JSON cache file that uglify will create and use to coordinate symbol mangling between
197194
multiple runs of uglify. Note: this generated file uses the same JSON format as the `exceptionsFiles` files.
198195

199-
#### quoteStyle
196+
#### output.quote_style
200197
Type: `Integer`
201198
Default: `0`
202199

@@ -248,15 +245,15 @@ grunt.initConfig({
248245

249246
#### Reserved identifiers
250247

251-
You can specify identifiers to leave untouched with an `except` array in the `mangle` options.
248+
You can specify identifiers to leave untouched with an `reserved` array in the `mangle` options.
252249

253250
```js
254251
// Project configuration.
255252
grunt.initConfig({
256253
uglify: {
257254
options: {
258255
mangle: {
259-
except: ['jQuery', 'Backbone']
256+
reserved: ['jQuery', 'Backbone']
260257
}
261258
},
262259
my_target: {
@@ -294,7 +291,7 @@ grunt.initConfig({
294291

295292
#### Advanced source maps
296293

297-
Set the `sourceMapIncludeSources` option to `true` to embed your sources directly into the map. To include
294+
Set the `sourceMap.includeSources` option to `true` to embed your sources directly into the map. To include
298295
a source map from a previous compilation pass it as the value of the `sourceMapIn` option.
299296

300297
```js
@@ -303,8 +300,9 @@ grunt.initConfig({
303300
uglify: {
304301
my_target: {
305302
options: {
306-
sourceMap: true,
307-
sourceMapIncludeSources: true,
303+
sourceMap: {
304+
includeSources: true
305+
},
308306
sourceMapIn: 'example/coffeescript-sourcemap.js', // input sourcemap from a previous compilation
309307
},
310308
files: {
@@ -315,7 +313,7 @@ grunt.initConfig({
315313
});
316314
```
317315

318-
Refer to the [UglifyJS SourceMap Documentation](http://lisperator.net/uglifyjs/codegen#source-map) for more information.
316+
Refer to the [UglifyJS SourceMap Documentation](https://github.com/mishoo/UglifyJS2#source-map-options) for more information.
319317

320318
#### Turn off console warnings
321319

@@ -343,11 +341,9 @@ grunt.initConfig({
343341
#### Beautify
344342

345343
Specify `beautify: true` to beautify your code for debugging/troubleshooting purposes.
346-
Pass an object to manually configure any other output options passed directly to `UglifyJS.OutputStream()`.
347-
348-
See [UglifyJS Codegen documentation](http://lisperator.net/uglifyjs/codegen) for more information.
344+
Pass an object to manually configure any other output options.
349345

350-
_Note that manual configuration will require you to explicitly set `beautify: true` if you want traditional, beautified output._
346+
See [UglifyJS documentation](https://github.com/mishoo/UglifyJS2#beautifier-options) for more information.
351347

352348
```js
353349
// Project configuration.
@@ -364,8 +360,7 @@ grunt.initConfig({
364360
my_advanced_target: {
365361
options: {
366362
beautify: {
367-
width: 80,
368-
beautify: true
363+
width: 80
369364
}
370365
},
371366
files: {
@@ -402,9 +397,9 @@ grunt.initConfig({
402397

403398
#### Conditional compilation
404399

405-
You can also enable UglifyJS conditional compilation. This is commonly used to remove debug code blocks for production builds. This is equivalent to the command line [`--define` option](https://github.com/mishoo/UglifyJS#use-as-a-code-pre-processor).
400+
You can also enable UglifyJS conditional compilation. This is commonly used to remove debug code blocks for production builds. This is equivalent to the command line `--define` option.
406401

407-
See [UglifyJS global definitions documentation](http://lisperator.net/uglifyjs/compress#global-defs) for more information.
402+
See [UglifyJS global definitions documentation](https://github.com/mishoo/UglifyJS2#conditional-compilation) for more information.
408403

409404
```js
410405
// Project configuration.
@@ -459,7 +454,7 @@ uglify: {
459454
dev: {
460455
options: {
461456
mangle: {
462-
except: ['jQuery']
457+
reserved: ['jQuery']
463458
}
464459
},
465460
files: [{
@@ -489,7 +484,9 @@ on the format of the exception file format please see the [UglifyJS docs](https:
489484
grunt.initConfig({
490485
uglify: {
491486
options: {
492-
mangleProperties: true,
487+
mangle: {
488+
properties: true
489+
},
493490
reserveDOMCache: true,
494491
exceptionsFiles: [ 'myExceptionsFile.json' ]
495492
},
@@ -528,6 +525,7 @@ grunt.initConfig({
528525

529526
## Release History
530527

528+
* 2017-05-12   v3.0.0   Update uglify-js to v3.0.4.
531529
* 2017-04-05   v2.3.0   Make CLI output less verbose.
532530
* 2017-03-31   v2.2.1   Fix banner option.
533531
* 2017-03-01   v2.2.0   Update uglify-js to v2.8.3.
@@ -571,4 +569,4 @@ grunt.initConfig({
571569

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

574-
*This file was generated on Wed Apr 05 2017 00:24:18.*
572+
*This file was generated on Fri May 12 2017 15:02:06.*

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "grunt-contrib-uglify",
33
"description": "Minify JavaScript files with UglifyJS",
4-
"version": "2.3.0",
4+
"version": "3.0.0",
55
"author": {
66
"name": "Grunt Team",
77
"url": "http://gruntjs.com/"

0 commit comments

Comments
 (0)