Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ once_cell = "1"
open = "5"
oxipng = "9"
rand = "0.9.0"
rapidhash = { version = "3" }
regex = "1"
remove_dir_all = "1"
reqwest = { version = "0.12", default-features = false, features = ["stream", "trust-dns"] }
schemars = { version = "0.8", features = ["derive"] }
seahash = { version = "4", features = ["use_std"] }
semver = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
Expand Down
2 changes: 1 addition & 1 deletion src/pipelines/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ impl AssetFile {
format!(
"{}-{:x}.{}",
&self.file_stem.to_string_lossy(),
seahash::hash(bytes.as_ref()),
rapidhash::v3::rapidhash_v3(bytes.as_ref()),
&self.ext.as_deref().unwrap_or_default()
)
} else {
Expand Down
11 changes: 3 additions & 8 deletions src/pipelines/rust/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ use crate::{
use anyhow::{anyhow, bail, ensure, Context, Result};
use cargo_metadata::{Artifact, TargetKind};
use minify_js::TopLevelMode;
use seahash::SeaHasher;
use std::{
collections::HashSet,
hash::Hasher,
path::{Path, PathBuf},
process::Stdio,
str::FromStr,
Expand Down Expand Up @@ -795,12 +793,9 @@ impl RustApp {
let hash = {
let path = path.to_owned();
tokio::task::spawn_blocking(move || {
let mut file = std::fs::File::open(&path)?;
let mut hasher = SeaHasher::new();
std::io::copy(&mut file, &mut hasher).with_context(|| {
format!("error reading '{}' for hash generation", path.display())
})?;
Ok::<_, anyhow::Error>(hasher.finish())
let file = std::fs::File::open(&path)?;
let hash = rapidhash::v3::rapidhash_v3_file(file)?;
Ok::<_, anyhow::Error>(hash)
})
.await??
};
Expand Down
2 changes: 1 addition & 1 deletion src/pipelines/sass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl Sass {
} else {
// Hash the contents to generate a file name, and then write the contents to the dist
// dir.
let hash = seahash::hash(css.as_bytes());
let hash = rapidhash::v3::rapidhash_v3(css.as_bytes());

let file_name = if self.cfg.filehash {
format!("{}-{:x}.css", &self.asset.file_stem.to_string_lossy(), hash)
Expand Down
2 changes: 1 addition & 1 deletion src/pipelines/tailwind_css.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl TailwindCss {
} else {
// Hash the contents to generate a file name, and then write the contents to the dist
// dir.
let hash = seahash::hash(css.as_bytes());
let hash = rapidhash::v3::rapidhash_v3(css.as_bytes());
let file_name = if self.cfg.filehash {
format!("{}-{:x}.css", &self.asset.file_stem.to_string_lossy(), hash)
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/pipelines/tailwind_css_extra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl TailwindCssExtra {
} else {
// Hash the contents to generate a file name, and then write the contents to the dist
// dir.
let hash = seahash::hash(css.as_bytes());
let hash = rapidhash::v3::rapidhash_v3(css.as_bytes());
let file_name = if self.cfg.filehash {
format!("{}-{:x}.css", &self.asset.file_stem.to_string_lossy(), hash)
} else {
Expand Down