build(color-module): 添加wasm随机数支持和internment依赖

添加getrandom wasm_js后端配置以支持wasm环境下的随机数生成
添加internment依赖用于优化内存管理
This commit is contained in:
徐涛 2025-07-18 13:46:43 +08:00
parent a71a635eb8
commit 137079e5c6
2 changed files with 3 additions and 1 deletions

View File

@ -10,6 +10,8 @@ crate-type = ["cdylib"]
[dependencies]
color-name = "1.1.0"
enum-iterator = "2.1.0"
getrandom = { version = "0.3.3", features = ["wasm_js"] }
internment = { version = "0.8.6", features = ["arc"] }
linked-hash-map = { version = "0.5.6", features = ["serde", "serde_impl"] }
linked_hash_set = { version = "0.1.5", features = ["serde"] }
palette = { version = "0.7.6", features = ["serde"] }

View File

@ -1,2 +1,2 @@
#!/bin/bash
wasm-pack build --release --target web -d ../color_functions
RUSTFLAGS='--cfg getrandom_backend="wasm_js"' wasm-pack build --release --target web -d ../color_functions