You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -28,10 +28,26 @@ Task targets, files and options may be specified according to the grunt [Configu
28
28
29
29
### Options
30
30
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.
@@ -50,9 +66,9 @@ Turn on or off source compression with default options. If an `Object` is specif
50
66
Type: `Boolean``Object`
51
67
Default: `false`
52
68
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)
54
70
55
-
###### expression
71
+
###### parse.expression
56
72
Type: `Boolean`
57
73
Default: `false`
58
74
@@ -86,33 +102,26 @@ The location of an input source map from an earlier compilation, e.g. from Coffe
86
102
uglify source is passed as the argument and the return value will be used as the sourceMap name. This only makes sense
87
103
when there's one source file.
88
104
89
-
#### sourceMapIncludeSources
105
+
#### sourceMap.includeSources
90
106
Type: `Boolean`
91
107
Default: `false`
92
108
93
109
Pass this flag if you want to include the content of source files in the source map as sourcesContent property.
94
110
95
-
###### sourceMapRoot
111
+
###### sourceMap.root
96
112
Type: `String`
97
113
Default: `undefined`
98
114
99
115
With this option you can customize root URL that browser will use when looking for sources.
100
116
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.
102
118
103
-
#### sourceMapUrl
119
+
#### sourceMap.url
104
120
Type: `String`
105
121
Default: `undefined`
106
122
107
123
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
108
124
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
-
116
125
#### wrap
117
126
Type: `String`
118
127
Default: `undefined`
@@ -121,25 +130,13 @@ Wrap all of the code in a closure, an easy way to make sure nothing is leaking.
121
130
For variables that need to be public `exports` and `global` variables are made available.
122
131
The value of wrap is the global variable exports will be available as.
123
132
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
131
134
Type: `Boolean`
132
135
Default: `false`
133
136
134
137
Enables to encode non-ASCII characters as \uXXXX.
135
138
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
143
140
Type: `Boolean``String``Function`
144
141
Default: `undefined`
145
142
Options: `false``'all'``'some'`
@@ -164,13 +161,13 @@ Default: `''`
164
161
165
162
This string will be appended to the minified output. Template strings (e.g. `<%= config.value %>` will be expanded automatically.
166
163
167
-
#### screwIE8
164
+
#### ie8
168
165
Type: `Boolean`
169
-
Default: `true`
166
+
Default: `false`
170
167
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.
172
169
173
-
#### mangleProperties
170
+
#### mangle.properties
174
171
Type: `Boolean``Object`
175
172
Default: `false`
176
173
@@ -180,13 +177,13 @@ Turn on or off property mangling with default options. If an `Object` is specifi
180
177
Type: `Boolean`
181
178
Default: `false`
182
179
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.
184
181
185
182
#### exceptionsFiles
186
183
Type: `Array`
187
184
Default: `[]`
188
185
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
190
187
that should not be mangled. See the [UglifyJS docs](https://www.npmjs.com/package/uglify-js) for more info on the file syntax.
191
188
192
189
#### nameCache
@@ -196,7 +193,7 @@ Default: `''`
196
193
A string that is a path to a JSON cache file that uglify will create and use to coordinate symbol mangling between
197
194
multiple runs of uglify. Note: this generated file uses the same JSON format as the `exceptionsFiles` files.
198
195
199
-
#### quoteStyle
196
+
#### output.quote_style
200
197
Type: `Integer`
201
198
Default: `0`
202
199
@@ -248,15 +245,15 @@ grunt.initConfig({
248
245
249
246
#### Reserved identifiers
250
247
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.
252
249
253
250
```js
254
251
// Project configuration.
255
252
grunt.initConfig({
256
253
uglify: {
257
254
options: {
258
255
mangle: {
259
-
except: ['jQuery', 'Backbone']
256
+
reserved: ['jQuery', 'Backbone']
260
257
}
261
258
},
262
259
my_target: {
@@ -294,7 +291,7 @@ grunt.initConfig({
294
291
295
292
#### Advanced source maps
296
293
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
298
295
a source map from a previous compilation pass it as the value of the `sourceMapIn` option.
299
296
300
297
```js
@@ -303,8 +300,9 @@ grunt.initConfig({
303
300
uglify: {
304
301
my_target: {
305
302
options: {
306
-
sourceMap:true,
307
-
sourceMapIncludeSources:true,
303
+
sourceMap: {
304
+
includeSources:true
305
+
},
308
306
sourceMapIn:'example/coffeescript-sourcemap.js', // input sourcemap from a previous compilation
309
307
},
310
308
files: {
@@ -315,7 +313,7 @@ grunt.initConfig({
315
313
});
316
314
```
317
315
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.
319
317
320
318
#### Turn off console warnings
321
319
@@ -343,11 +341,9 @@ grunt.initConfig({
343
341
#### Beautify
344
342
345
343
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.
349
345
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.
351
347
352
348
```js
353
349
// Project configuration.
@@ -364,8 +360,7 @@ grunt.initConfig({
364
360
my_advanced_target: {
365
361
options: {
366
362
beautify: {
367
-
width:80,
368
-
beautify:true
363
+
width:80
369
364
}
370
365
},
371
366
files: {
@@ -402,9 +397,9 @@ grunt.initConfig({
402
397
403
398
#### Conditional compilation
404
399
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.
406
401
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.
408
403
409
404
```js
410
405
// Project configuration.
@@ -459,7 +454,7 @@ uglify: {
459
454
dev: {
460
455
options: {
461
456
mangle: {
462
-
except: ['jQuery']
457
+
reserved: ['jQuery']
463
458
}
464
459
},
465
460
files: [{
@@ -489,7 +484,9 @@ on the format of the exception file format please see the [UglifyJS docs](https:
489
484
grunt.initConfig({
490
485
uglify: {
491
486
options: {
492
-
mangleProperties:true,
487
+
mangle: {
488
+
properties:true
489
+
},
493
490
reserveDOMCache:true,
494
491
exceptionsFiles: [ 'myExceptionsFile.json' ]
495
492
},
@@ -528,6 +525,7 @@ grunt.initConfig({
528
525
529
526
## Release History
530
527
528
+
* 2017-05-12 v3.0.0 Update uglify-js to v3.0.4.
531
529
* 2017-04-05 v2.3.0 Make CLI output less verbose.
532
530
* 2017-03-31 v2.2.1 Fix banner option.
533
531
* 2017-03-01 v2.2.0 Update uglify-js to v2.8.3.
@@ -571,4 +569,4 @@ grunt.initConfig({
571
569
572
570
Task submitted by ["Cowboy" Ben Alman](http://benalman.com)
573
571
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.*
0 commit comments