Cache hashed assets forever in fullstack (#3928)
* Cache hashed assets forever in fullstack * fix clippy * fix fullstack test port * fix fullstack clippy * fix double insertion of meta in fullstack test * pull out head element changes * Fix cli-optimization test when interrupted * remove tests for raw assets * fix playwright tests * look for hash in asset name instead of building a manifest * undo changes to cli * fix clippy * fix test_file_name_looks_immutable
This commit is contained in:
1 parent
09d8e3aef2
commit
76ffcabd0b
10 files changed
+165
-40
No files matched your search
@@ -1,3 +1,4 @@
|
||||
dist
|
||||
target
|
||||
monaco-editor-0.52.2
|
||||
monaco-editor
|
||||
partial-monaco-editor
|
||||
@@ -2,7 +2,7 @@ use std::path::PathBuf;
|
||||
|
||||
fn main() {
|
||||
// If the monaco editor folder doesn't exist, download it
|
||||
let monaco_path = PathBuf::from("monaco-editor-0.52.2");
|
||||
let monaco_path = PathBuf::from("monaco-editor");
|
||||
if monaco_path.exists() {
|
||||
return;
|
||||
}
|
||||
@@ -10,5 +10,7 @@ fn main() {
|
||||
let url = "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.52.2.tgz";
|
||||
let bytes = reqwest::blocking::get(url).unwrap().bytes().unwrap();
|
||||
let mut archive = tar::Archive::new(flate2::read::GzDecoder::new(bytes.as_ref()));
|
||||
archive.unpack(&monaco_path).unwrap();
|
||||
let monaco_path_partial = PathBuf::from("partial-monaco-editor");
|
||||
archive.unpack(&monaco_path_partial).unwrap();
|
||||
std::fs::rename(monaco_path_partial, monaco_path).unwrap();
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
use dioxus::prelude::*;
|
||||
|
||||
const MONACO_FOLDER: Asset = asset!("/monaco-editor-0.52.2/package/min/vs");
|
||||
const MONACO_FOLDER: Asset = asset!("/monaco-editor/package/min/vs");
|
||||
const SOME_IMAGE: Asset = asset!("/images/toasts.png", ImageAssetOptions::new().with_avif());
|
||||
const SOME_IMAGE_WITH_THE_SAME_URL: Asset =
|
||||
asset!("/images/toasts.png", ImageAssetOptions::new().with_jpg());
|
||||
|
||||
Reference in new issue
Block a user