pub struct TreeShaker { /* private fields */ }Expand description
Tree-shaking system for CSS optimization
Implementations§
Source§impl TreeShaker
impl TreeShaker
Sourcepub fn with_config(config: TreeShakeConfig) -> Self
pub fn with_config(config: TreeShakeConfig) -> Self
Create a new tree-shaker with custom configuration
Sourcepub fn shake(
&mut self,
source_paths: &[&Path],
css_generator: &mut CssGenerator,
) -> Result<TreeShakeResults>
pub fn shake( &mut self, source_paths: &[&Path], css_generator: &mut CssGenerator, ) -> Result<TreeShakeResults>
Analyze source files and remove unused CSS classes
Sourcepub fn get_config(&self) -> &TreeShakeConfig
pub fn get_config(&self) -> &TreeShakeConfig
Get the current configuration
Sourcepub fn set_config(&mut self, config: TreeShakeConfig)
pub fn set_config(&mut self, config: TreeShakeConfig)
Update the configuration
Sourcepub fn keep_class(&mut self, class: String)
pub fn keep_class(&mut self, class: String)
Add a class to the whitelist
Sourcepub fn remove_class(&mut self, class: String)
pub fn remove_class(&mut self, class: String)
Add a class to the blacklist
Trait Implementations§
Source§impl Clone for TreeShaker
impl Clone for TreeShaker
Source§fn clone(&self) -> TreeShaker
fn clone(&self) -> TreeShaker
Returns a duplicate 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 TreeShaker
impl Debug for TreeShaker
Auto Trait Implementations§
impl Freeze for TreeShaker
impl RefUnwindSafe for TreeShaker
impl Send for TreeShaker
impl Sync for TreeShaker
impl Unpin for TreeShaker
impl UnwindSafe for TreeShaker
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