Fix: Asset Cache On Windows & Asset Status (#3525)

* fix: asset caching on windows
* fix: asset status
This commit is contained in:
Miles Murgaw authored and GitHub committed 2025-01-08 15:08:18 -08:00
1 parent 5ea0867a34
commit a3812d66da
8 files changed
+23 -17

No files matched your search

@@ -19,6 +19,7 @@ proc-macro2 = { workspace = true }
quote = { workspace = true }
syn = { workspace = true, features = ["full", "extra-traits"] }
manganis-core = { workspace = true }
dunce = { workspace = true }
[features]
default = []
@@ -17,11 +17,12 @@ fn resolve_path(raw: &str) -> Result<PathBuf, AssetParseError> {
// /users/dioxus/dev/app/
// is the root of
// /users/dioxus/dev/app/assets/blah.css
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR")
.map(PathBuf::from)
.unwrap()
.canonicalize()
.unwrap();
let manifest_dir = dunce::canonicalize(
std::env::var("CARGO_MANIFEST_DIR")
.map(PathBuf::from)
.unwrap(),
)
.unwrap();
// 1. the input file should be a pathbuf
let input = PathBuf::from(raw);
@@ -34,7 +35,7 @@ fn resolve_path(raw: &str) -> Result<PathBuf, AssetParseError> {
};
// 3. Ensure the path exists
let Ok(path) = path.canonicalize() else {
let Ok(path) = dunce::canonicalize(path) else {
return Err(AssetParseError::AssetDoesntExist {
path: input.clone(),
});