Module: Opal::Util

Extended by:
Util
Included in:
Util
Defined in:
opal/lib/opal/util.rb

Constant Summary collapse

ExitStatusError =
Class.new(StandardError)

Instance Method Summary collapse

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) ⇒ String

Used for uglifying source to minify.

Opal::Util.uglify("javascript contents")

Parameters:

  • str (String)

    string to minify

Returns:

  • (String)


17
18
19
# File 'opal/lib/opal/util.rb', line 17

def uglify(source)
  sh 'bin/yarn -s run uglifyjs -c', data: source
end