-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrap the uglifier compressor with harmony support
* Allows es6 code that regular Uglifier doesn't support * Avoids requiring Uglifier in all rails processes at application startup. * Uglifier requires a js runtime such as node * JS runtime can continue to be only available in development and for production pre-compilation This is a better solution than #9244 Note, the original es6 workaround suggested by Uglifier is to use this harmony support: https://www.github.com/lautis/uglifier/issues/127
- Loading branch information
Showing
2 changed files
with
22 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module ManageIQ | ||
module UI | ||
module Classic | ||
class JsCompressor < Sprockets::UglifierCompressor | ||
def initialize(options = {}) | ||
warn "\e[33m** Using #{self.class.name} with Uglifier.new(:harmony => true) from: #{__FILE__}:#{__LINE__}\e[0m" | ||
options[:harmony] = true | ||
super(options) | ||
end | ||
end | ||
end | ||
end | ||
end |