Rust lightningcss minify

Viewed 31

Trying to figure out how to use minify from lightningcss. Here's my code

let fs = FileProvider::new();
let mut bundler = Bundler::new(&fs, None, ParserOptions::default());
let stylesheet = bundler.bundle(Path::new("./assets/css/global.css")).unwrap();
stylesheet.minify(MinifyOptions::default());
println!("{}", stylesheet.to_css(PrinterOptions::default()).unwrap().code);

If I try to print the unwrapped version of the minified output that is empty.

taken more from here https://docs.rs/lightningcss/1.0.0-alpha.34/lightningcss/stylesheet/struct.StyleSheet.html

And the question: how do I use the minify output?

0 Answers
Related