| Class | Uglifier |
| In: |
lib/uglifier.rb
|
| Parent: | Object |
| Error | = | ExecJS::Error | ||
| DEFAULTS | = | { :output => { :ascii_only => false, # Escape non-ASCII characterss :comments => :copyright, # Preserve comments (:all, :jsdoc, :copyright, :none) :inline_script => false, # Escape occurrences of </script in strings :quote_keys => false, # Quote keys in object literals :max_line_len => 32 * 1024, # Maximum line length in minified code :bracketize => false, # Bracketize if, for, do, while or with statements, even if their body is a single statement :semicolons => true, # Separate statements with semicolons :preserve_line => false, # Preserve line numbers in outputs :beautify => false, # Beautify output :indent_level => 4, # Indent level in spaces :indent_start => 0, # Starting indent level :space_colon => false, # Insert space before colons (only with beautifier) :width => 80 | Default options for compilation | |
| SourcePath | = | File.expand_path("../uglify.js", __FILE__) | ||
| ES5FallbackPath | = | File.expand_path("../es5.js", __FILE__) | ||
| SplitFallbackPath | = | File.expand_path("../split.js", __FILE__) |
Minifies JavaScript code using implicit context.
source should be a String or IO object containing valid JavaScript. options contain optional overrides to Uglifier::DEFAULTS
Returns minified code as String
Minifies JavaScript code and generates a source map using implicit context.
source should be a String or IO object containing valid JavaScript. options contain optional overrides to Uglifier::DEFAULTS
Returns a pair of [minified code as String, source map as a String]
Minifies JavaScript code
source should be a String or IO object containing valid JavaScript.
Returns minified code as String