Skip to content

Commit

Permalink
maxLineLen and ASCIIOnly options support
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitaeverywhere committed Aug 27, 2014
1 parent e002480 commit 9179ebc
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,18 @@ 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.

## maxLineLen
Type: `Number`
Default: `32000`

Limit the line length in symbols. Pass maxLineLen = 0 to disable this safety feature.

## ASCIIOnly
Type: `Boolean`
Default: `false`

Enables to encode non-ASCII characters as \uXXXX.

#### exportAll
Type: `Boolean`
Default: `false`
Expand Down
12 changes: 12 additions & 0 deletions docs/uglify-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ 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.

## maxLineLen
Type: `Number`
Default: `32000`

Limit the line length in symbols. Pass maxLineLen = 0 to disable this safety feature.

## ASCIIOnly
Type: `Boolean`
Default: `false`

Enables to encode non-ASCII characters as \uXXXX.

## exportAll
Type: `Boolean`
Default: `false`
Expand Down
8 changes: 8 additions & 0 deletions tasks/lib/uglify.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,14 @@ exports.init = function(grunt) {
outputOptions.indent_level = options.indentLevel;
}

if (options.maxLineLen !== undefined) {
outputOptions.max_line_len = options.maxLineLen;
}

if (options.ASCIIOnly !== undefined) {
outputOptions.ascii_only = options.ASCIIOnly;
}

return outputOptions;
};

Expand Down
4 changes: 3 additions & 1 deletion tasks/uglify.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ module.exports = function(grunt) {
mangle: {},
beautify: false,
report: 'min',
expression: false
expression: false,
maxLineLen: 32000,
ASCIIOnly: false
});

// Process banner.
Expand Down

0 comments on commit 9179ebc

Please sign in to comment.