pub struct Cfg {Show 15 fields
pub allow_noncompliant_unquoted_attribute_values: bool,
pub allow_optimal_entities: bool,
pub allow_removing_spaces_between_attributes: bool,
pub keep_closing_tags: bool,
pub keep_comments: bool,
pub keep_html_and_head_opening_tags: bool,
pub keep_input_type_text_attr: bool,
pub keep_ssi_comments: bool,
pub minify_css: bool,
pub minify_doctype: bool,
pub minify_js: bool,
pub preserve_brace_template_syntax: bool,
pub preserve_chevron_percent_template_syntax: bool,
pub remove_bangs: bool,
pub remove_processing_instructions: bool,
}
Expand description
Configuration settings that can be adjusted and passed to a minification function to change the minification approach.
Fields§
§allow_noncompliant_unquoted_attribute_values: bool
Allow unquoted attribute values in the output to contain characters prohibited by the WHATWG specification. These will still be parsed correctly by almost all browsers.
allow_optimal_entities: bool
Allow some minifications around entities that may not pass validation, but will still be parsed correctly by almost all browsers.
allow_removing_spaces_between_attributes: bool
Allow removing_spaces between attributes when possible, which may not be spec compliant. These will still be parsed correctly by almost all browsers.
Do not omit closing tags when possible.
keep_comments: bool
Keep all comments.
Do not omit <html>
and <head>
opening tags when they don’t have attributes.
keep_input_type_text_attr: bool
Keep type=text
attribute name and value on <input>
elements.
keep_ssi_comments: bool
Keep SSI comments.
minify_css: bool
Minify CSS in <style>
tags and style
attributes using https://github.com/parcel-bundler/lightningcss.
minify_doctype: bool
Minify DOCTYPEs. Minified DOCTYPEs may not be spec compliant, but will still be parsed correctly by almost all browsers.
minify_js: bool
Minify JavaScript in <script>
tags using minify-js.
preserve_brace_template_syntax: bool
When {{
, {#
, or {%
are seen in content, all source code until the subsequent matching closing }}
, #}
, or %}
respectively gets piped through untouched.
preserve_chevron_percent_template_syntax: bool
When <%
is seen in content, all source code until the subsequent matching closing %>
gets piped through untouched.
remove_bangs: bool
Remove all bangs.
remove_processing_instructions: bool
Remove all processing instructions.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cfg
impl RefUnwindSafe for Cfg
impl Send for Cfg
impl Sync for Cfg
impl Unpin for Cfg
impl UnwindSafe for Cfg
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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>
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>
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