Gowee / zhconv-rs

🦀 Convert Chinese text among Trad/Simp and regional variants | 中文简繁及地區詞轉換
https://zhconv.pages.dev
GNU General Public License v3.0
27 stars 3 forks source link

Add feature wasm #5

Closed hsfzxjy closed 4 months ago

hsfzxjy commented 4 months ago

Currently zhconv-rs forcibly adds #[wasm_bindgen] to its public functions when target = wasm, leading to that these functions always appear in the generated binary, which is not desired when zhconv-rs is used as an dependency for a wasm program. This PR adds a feature to disable such behavior.

Gowee commented 4 months ago

LGTM. The wasm-bindgen was activated by default since it is impossible to set feature flags with wasm-pack-plugin, which is required by the web app. Now I am kind of not sure whether it is good to leave such feature enabled by default.

Gowee commented 4 months ago

Thanks!