Compare commits
No commits in common. "0d61c217482db99b6321ce85c819e1b235c0e705" and "b34dbde83e28e633270c3067592fb2b75fae0ace" have entirely different histories.
0d61c21748
...
b34dbde83e
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"tabWidth": 4
|
|
||||||
}
|
|
13
build.rs
13
build.rs
@ -4,7 +4,8 @@ use std::io::Write;
|
|||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
use lightningcss::printer::PrinterOptions;
|
use lightningcss::printer::PrinterOptions;
|
||||||
use lightningcss::stylesheet::{ParserOptions, StyleSheet};
|
use lightningcss::stylesheet::{self, ParserOptions, StyleSheet};
|
||||||
|
|
||||||
|
|
||||||
fn main() -> Result<(), Box<dyn Error>> {
|
fn main() -> Result<(), Box<dyn Error>> {
|
||||||
let scss_path = Path::new("styles/global.scss");
|
let scss_path = Path::new("styles/global.scss");
|
||||||
@ -18,12 +19,10 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
.map_err(|e| Box::new(e) as Box<dyn Error>)?;
|
.map_err(|e| Box::new(e) as Box<dyn Error>)?;
|
||||||
|
|
||||||
let stylesheet = StyleSheet::parse(&css, ParserOptions::default()).unwrap();
|
let stylesheet = StyleSheet::parse(&css, ParserOptions::default()).unwrap();
|
||||||
let minified_css = stylesheet
|
let minified_css = stylesheet.to_css(PrinterOptions {
|
||||||
.to_css(PrinterOptions {
|
minify: true,
|
||||||
minify: true,
|
..PrinterOptions::default()
|
||||||
..PrinterOptions::default()
|
}).unwrap();
|
||||||
})
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let mut output_file = File::create(css_output_path)?;
|
let mut output_file = File::create(css_output_path)?;
|
||||||
output_file.write_all(minified_css.code.as_bytes())?;
|
output_file.write_all(minified_css.code.as_bytes())?;
|
||||||
|
Reference in New Issue
Block a user