rspack_style 0.1.16

a rust toolkit bundled for front-end style files
Documentation
use rspack_style::util::file::{path_resolve, readfile};
use rspack_style::util::hash::StyleHash;

#[test]
fn test_content_hash() {
  let content = "hello world";
  let hash_value = StyleHash::generate_hash_by_content(content);
  println!("{}", hash_value);
  let hash_value2 = StyleHash::generate_hash_by_content(content);
  println!("{}", hash_value2);
  let target_code = "8170069951894177743".to_string();
  assert_eq!(hash_value, hash_value2);
  assert_eq!(target_code, hash_value);
}

#[test]
fn test_css_module_hash() {
  let filepath = path_resolve("assets/demo.less");
  let content = readfile(&filepath).unwrap();
  let css_module_hash = StyleHash::generate_css_module_hash(&filepath, &content);
  println!("{}", css_module_hash);
}