pub struct CompressOptions {Show 55 fields
pub arguments: bool,
pub arrows: bool,
pub bools: bool,
pub bools_as_ints: bool,
pub collapse_vars: bool,
pub comparisons: bool,
pub computed_props: bool,
pub conditionals: bool,
pub dead_code: bool,
pub directives: bool,
pub drop_console: bool,
pub drop_debugger: bool,
pub ecma: EsVersion,
pub evaluate: bool,
pub expr: bool,
pub global_defs: AHashMap<Box<Expr>, Box<Expr>>,
pub hoist_fns: bool,
pub hoist_props: bool,
pub hoist_vars: bool,
pub ie8: bool,
pub if_return: bool,
pub inline: u8,
pub join_vars: bool,
pub keep_classnames: bool,
pub keep_fargs: bool,
pub keep_fnames: bool,
pub keep_infinity: bool,
pub loops: bool,
pub module: bool,
pub negate_iife: bool,
pub passes: usize,
pub props: bool,
pub pure_getters: PureGetterOption,
pub pure_funcs: Vec<Box<Expr>>,
pub reduce_fns: bool,
pub reduce_vars: bool,
pub sequences: u8,
pub side_effects: bool,
pub switches: bool,
pub top_retain: Vec<JsWord>,
pub top_level: Option<TopLevelOptions>,
pub typeofs: bool,
pub unsafe_passes: bool,
pub unsafe_arrows: bool,
pub unsafe_comps: bool,
pub unsafe_function: bool,
pub unsafe_math: bool,
pub unsafe_symbols: bool,
pub unsafe_methods: bool,
pub unsafe_proto: bool,
pub unsafe_regexp: bool,
pub unsafe_undefined: bool,
pub unused: bool,
pub const_to_let: bool,
pub pristine_globals: bool,
}
Expand description
https://terser.org/docs/api-reference.html#compress-options
Fields§
§arguments: bool
§arrows: bool
§bools: bool
§bools_as_ints: bool
§collapse_vars: bool
§comparisons: bool
§computed_props: bool
§conditionals: bool
§dead_code: bool
§directives: bool
§drop_console: bool
§drop_debugger: bool
§ecma: EsVersion
§evaluate: bool
§expr: bool
Should we simplify expressions?
global_defs: AHashMap<Box<Expr>, Box<Expr>>
All expressions should have dummy span. Use swc_ecma_utils::drop_span to remove spans.
hoist_fns: bool
§hoist_props: bool
§hoist_vars: bool
§ie8: bool
No effect.
if_return: bool
§inline: u8
0
: disabled inlining1
: inline simple functions2
: inline functions with arguments3
: inline functions with arguments and variables
join_vars: bool
§keep_classnames: bool
§keep_fargs: bool
§keep_fnames: bool
§keep_infinity: bool
§loops: bool
§module: bool
§negate_iife: bool
§passes: usize
If this value is zero, the minifier will repeat work until the ast node is settled.
props: bool
§pure_getters: PureGetterOption
§pure_funcs: Vec<Box<Expr>>
§reduce_fns: bool
§reduce_vars: bool
§sequences: u8
§side_effects: bool
§switches: bool
§top_retain: Vec<JsWord>
Top level symbols to retain.
top_level: Option<TopLevelOptions>
§typeofs: bool
§unsafe_passes: bool
§unsafe_arrows: bool
§unsafe_comps: bool
§unsafe_function: bool
§unsafe_math: bool
§unsafe_symbols: bool
§unsafe_methods: bool
§unsafe_proto: bool
§unsafe_regexp: bool
§unsafe_undefined: bool
§unused: bool
§const_to_let: bool
§pristine_globals: bool
If you modified globals, set this to false.
Defaults to true.
Trait Implementations§
source§impl Clone for CompressOptions
impl Clone for CompressOptions
source§fn clone(&self) -> CompressOptions
fn clone(&self) -> CompressOptions
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CompressOptions
impl Debug for CompressOptions
source§impl Default for CompressOptions
impl Default for CompressOptions
source§impl<'de> Deserialize<'de> for CompressOptions
impl<'de> Deserialize<'de> for CompressOptions
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CompressOptions
impl RefUnwindSafe for CompressOptions
impl Send for CompressOptions
impl Sync for CompressOptions
impl Unpin for CompressOptions
impl UnwindSafe for CompressOptions
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more