From 9f1761b730ed08de2c18637ae141a50d2fd906c9 Mon Sep 17 00:00:00 2001 From: Hung-I Date: Fri, 22 Mar 2024 23:16:32 +0800 Subject: [PATCH] feat: disable opencc by default --- Cargo.toml | 8 ++++---- pyo3/pyproject.toml | 2 +- web/config-overrides.js | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fb246e2..d58efd3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,10 +12,10 @@ version = "0.3.1" crate-type = ["cdylib", "rlib"] [features] -# OpenCC rulesets are activated by default. -# Disabling the feature would reduce binary size significantly and boost performance further at -# the cost of accuracy. -default = ["opencc", "compress"] +# OpenCC rulesets are disabled by default. +# Enable the feature may improve accuracy at the cost of binary size bloating and performance +# degration. +default = ["compress"] opencc = ["lazy_static"] compress = ["zstd", "ruzstd"] diff --git a/pyo3/pyproject.toml b/pyo3/pyproject.toml index fb2a452..8a28d60 100644 --- a/pyo3/pyproject.toml +++ b/pyo3/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["maturin>=0.14,<0.15"] +requires = ["maturin>=1.5,<1.6"] build-backend = "maturin" [project] diff --git a/web/config-overrides.js b/web/config-overrides.js index 41cbcb4..ec177f3 100644 --- a/web/config-overrides.js +++ b/web/config-overrides.js @@ -12,6 +12,7 @@ module.exports = function override(config, env) { new WasmPackPlugin({ crateDirectory: path.resolve(__dirname, "../"), withTypeScript: true, + extraArgs: "-- --features opencc", // NOTE: it is 'index' by default, different from the default (package name) of wasm-pack outName: 'zhconv' }));