Class: Oxc::Minifier
- Inherits:
-
Object
- Object
- Oxc::Minifier
- Defined in:
- lib/oxc/minifier.rb,
sig/oxc/minifier.rbs
Instance Attribute Summary collapse
- #options ⇒ Hash[Symbol, untyped] readonly
Instance Method Summary collapse
-
#initialize(**options) ⇒ Minifier
constructor
: (?filename: String?, ?lang: String?, ?source_type: String?, ?compress: compress?, ?mangle: mangle?, ?codegen: codegen?, ?sourcemap: bool, ?strict: bool) -> void.
-
#inspect ⇒ String
: () -> String.
-
#minify(source, **overrides) ⇒ Oxc::MinifyResult
(also: #call)
: (String, ?filename: String?, ?lang: String?, ?source_type: String?, ?compress: compress?, ?mangle: mangle?, ?codegen: codegen?, ?sourcemap: bool, ?strict: bool) -> Oxc::MinifyResult.
-
#with(**overrides) ⇒ Oxc::Minifier
: (?filename: String?, ?lang: String?, ?source_type: String?, ?compress: compress?, ?mangle: mangle?, ?codegen: codegen?, ?sourcemap: bool, ?strict: bool) -> Oxc::Minifier.
Constructor Details
#initialize(**options) ⇒ Minifier
: (?filename: String?, ?lang: String?, ?source_type: String?, ?compress: compress?, ?mangle: mangle?, ?codegen: codegen?, ?sourcemap: bool, ?strict: bool) -> void
8 9 10 11 12 |
# File 'lib/oxc/minifier.rb', line 8 def initialize(**) @options = .transform_keys(&:to_sym).freeze freeze end |
Instance Attribute Details
#options ⇒ Hash[Symbol, untyped] (readonly)
5 6 7 |
# File 'lib/oxc/minifier.rb', line 5 def @options end |
Instance Method Details
#inspect ⇒ String
: () -> String
27 28 29 |
# File 'lib/oxc/minifier.rb', line 27 def inspect "#<#{self.class.name} #{.inspect}>" end |
#minify(source, **overrides) ⇒ Oxc::MinifyResult Also known as: call
: (String, ?filename: String?, ?lang: String?, ?source_type: String?, ?compress: compress?, ?mangle: mangle?, ?codegen: codegen?, ?sourcemap: bool, ?strict: bool) -> Oxc::MinifyResult
15 16 17 |
# File 'lib/oxc/minifier.rb', line 15 def minify(source, **overrides) Oxc.minify(source, **, **overrides) end |
#with(**overrides) ⇒ Oxc::Minifier
: (?filename: String?, ?lang: String?, ?source_type: String?, ?compress: compress?, ?mangle: mangle?, ?codegen: codegen?, ?sourcemap: bool, ?strict: bool) -> Oxc::Minifier
22 23 24 |
# File 'lib/oxc/minifier.rb', line 22 def with(**overrides) self.class.new(**, **overrides) end |