diff --git a/Cargo.toml b/Cargo.toml index 04e692f..f550f6a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rxing-wasm" -version = "0.3.1" +version = "0.3.2" edition = "2021" description = "wasm bindings for rxing to provide commong barcode operations (decode/encode)" repository = "https://github.com/rxing-core/rxing-wasm" @@ -17,8 +17,8 @@ decode_hints = [] [dependencies] wasm-bindgen = "0.2.92" -js-sys = "0.3.69" -web-sys = {version = "0.3.69", features = ["CanvasRenderingContext2d", "HtmlCanvasElement", "ImageData"]} +js-sys = "0.3.76" +web-sys = {version = "0.3.76", features = ["CanvasRenderingContext2d", "HtmlCanvasElement", "ImageData"]} # The `console_error_panic_hook` crate provides better debugging of panics by # logging them with `console.error`. This is great for development, but requires @@ -26,7 +26,7 @@ web-sys = {version = "0.3.69", features = ["CanvasRenderingContext2d", "HtmlCan # code size when deploying. console_error_panic_hook = { version = "0.1.7", optional = true } -rxing = {version = "~0.6.1", default-features = false, features = ["wasm_support"]} +rxing = {version = "~0.6.3", default-features = false, features = ["wasm_support"]} #rxing = {path="../rxing", version = "~0.2.23", default-features = false, features = ["wasm_support"]} [dev-dependencies] @@ -36,3 +36,6 @@ wasm-bindgen-test = "0.3.34" # Tell `rustc` to optimize for small code size. opt-level = "s" lto = "fat" + +[package.metadata.wasm-pack.profile.release] +wasm-opt = false diff --git a/build-wasm.sh b/build-wasm.sh new file mode 100755 index 0000000..777b874 --- /dev/null +++ b/build-wasm.sh @@ -0,0 +1,5 @@ +#! /bin/sh + +wasm-pack build --release +wasm-opt pkg/rxing_wasm_bg.wasm -o pkg/rxing_wasm_bg-opt.wasm --enable-bulk-memory -O1 --inlining-optimizing --heap-store-optimization --optimize-casts -O4 +mv pkg/rxing_wasm_bg-opt.wasm pkg/rxing_wasm_bg.wasm diff --git a/examples/webpack+js/index.html b/examples/webpack+js/index.html index 516fcd9..f4e77a9 100644 --- a/examples/webpack+js/index.html +++ b/examples/webpack+js/index.html @@ -106,4 +106,4 @@