Skip to content

Commit

Permalink
enable optimize for size by default in release
Browse files Browse the repository at this point in the history
  • Loading branch information
r58Playz committed Dec 19, 2024
1 parent d1318a4 commit 4497455
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"build": "rspack build --mode production",
"rewriter:build": "cd rewriter/wasm/ && bash build.sh && cd ../../",
"dev": "node server.js",
"prepack": "RELEASE=1 npm run rewriter:build && npm run build",
"prepack": "OPTIMIZE_FOR_SIZE=1 RELEASE=1 npm run rewriter:build && npm run build",
"pub": "npm publish --no-git-checks --access public",
"format": "prettier --config .prettierrc.js --write .",
"lint": "eslint ./src/",
Expand Down
2 changes: 2 additions & 0 deletions rewriter/wasm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ if ! [[ "$(wasm-bindgen -V)" =~ ^"$WBG" ]]; then
exit 1
fi

echo "FLAGS: RELEASE=${RELEASE:-0} OPTIMIZE_FOR_SIZE=${OPTIMIZE_FOR_SIZE:-0}"

if ! [ "${RELEASE:-0}" = "1" ]; then
: "${WASMOPTFLAGS:=-g}"
: "${FEATURES:=debug}"
Expand Down

0 comments on commit 4497455

Please sign in to comment.