Skip to content

Commit 50f5a17

Browse files
authored
Enable wasm2js optimization (#192)
## ๐ŸŽŸ๏ธ Tracking <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> ## ๐Ÿ“” Objective Just found out that we can also enable the `-Os` optimization used for `wasm-opt` in the `wasm2js` binary, reducing the JS size from 15Mb to 7Mb. ## โฐ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## ๐Ÿฆฎ Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - ๐Ÿ‘ (`:+1:`) or similar for great changes - ๐Ÿ“ (`:memo:`) or โ„น๏ธ (`:information_source:`) for notes or general info - โ“ (`:question:`) for questions - ๐Ÿค” (`:thinking:`) or ๐Ÿ’ญ (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - ๐ŸŽจ (`:art:`) for suggestions / improvements - โŒ (`:x:`) or โš ๏ธ (`:warning:`) for more significant problems or concerns needing attention - ๐ŸŒฑ (`:seedling:`) or โ™ป๏ธ (`:recycle:`) for future improvements or indications of technical debt - โ› (`:pick:`) for minor or nitpick changes
1 parent 8a7752e commit 50f5a17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

โ€Žcrates/bitwarden-wasm-internal/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ wasm-opt -Os ./crates/bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.was
3737
wasm-opt -Os ./crates/bitwarden-wasm-internal/npm/node/bitwarden_wasm_internal_bg.wasm -o ./crates/bitwarden-wasm-internal/npm/node/bitwarden_wasm_internal_bg.wasm
3838

3939
# Transpile to JS
40-
wasm2js ./crates/bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm -o ./crates/bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm.js
40+
wasm2js -Os ./crates/bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm -o ./crates/bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm.js
4141
npx terser ./crates/bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm.js -o ./crates/bitwarden-wasm-internal/npm/bitwarden_wasm_internal_bg.wasm.js

0 commit comments

Comments
ย (0)