Skip to content

Commit 4eb1051

Browse files
Boshenclaude
andcommitted
perf: make url crate optional for wasm32 targets
Move the `url` crate dependency from main dependencies to a target-specific dependency for non-wasm32 platforms. The `url` crate is only needed for the `to_file_path()` method which doesn't work on wasm32 (no filesystem concept). This reduces the dependency footprint for wasm32 builds where the `url` crate cannot be used anyway. Changes: - Remove `url = "2"` from main dependencies - Add `url = "2"` under `[target.'cfg(not(target_arch = "wasm32"))'.dependencies]` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 28b8920 commit 4eb1051

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,14 @@ serde_json = { version = "1", features = ["preserve_order"] } # preserve_order:
8888
simdutf8 = { version = "0.1" }
8989
thiserror = "2"
9090
tracing = "0.1"
91-
url = "2"
9291

9392
pnp = { version = "0.12.2", optional = true }
9493

9594
document-features = { version = "0.2.11", optional = true }
9695

96+
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
97+
url = "2"
98+
9799
[target.'cfg(any(target_os = "macos", target_os = "linux"))'.dependencies]
98100
libc = "0.2"
99101

0 commit comments

Comments
 (0)