Module: Opal::Util
Constant Summary collapse
- ExitStatusError =
Class.new(StandardError)
Instance Method Summary collapse
-
#gzip(source) ⇒ Object
Gzip code to check file size.
-
#uglify(source, mangle: false) ⇒ String
Used for uglifying source to minify.
Instance Method Details
#gzip(source) ⇒ Object
Gzip code to check file size.
22 23 24
# File 'opal/lib/opal/util.rb', line 22 def gzip(source) sh 'gzip -f', data: source end
#uglify(source, mangle: false) ⇒ String
Parameters:
-
str
(String)
—
string to minify
Returns:
- (String)
17 18 19
# File 'opal/lib/opal/util.rb', line 17 def uglify(source, mangle: false) sh "#{'ruby ' if Gem.win_platform?}bin/yarn -s run terser -c #{'-m' if mangle}", data: source end