1
Fork 0

Generate static file hashes once

This commit is contained in:
Jacob Hoffman-Andrews 2022-10-29 01:57:39 -07:00
parent bf25334066
commit 0b0bf10533
2 changed files with 23 additions and 15 deletions

View file

@ -85,12 +85,11 @@ pub(super) fn write_shared(
}
if options.emit.is_empty() || options.emit.contains(&EmitType::Toolchain) {
for f in static_files::STATIC_FILES_LIST {
let filename = cx.dst.join(
Path::new("static.files/").join(static_files::static_filename(f.filename, f.bytes)),
);
cx.shared.fs.write(filename, f.minified())?;
}
let static_dir = cx.dst.join(Path::new("static.files"));
static_files::for_each(|f: &static_files::StaticFile| {
let filename = static_dir.join(f.output_filename());
cx.shared.fs.write(filename, f.minified())
})?;
}
/// Read a file and return all lines that match the `"{crate}":{data},` format,