diff --git a/bindings/wasm/Cargo.toml b/bindings/wasm/Cargo.toml index f28d861677..fda59fd4cb 100644 --- a/bindings/wasm/Cargo.toml +++ b/bindings/wasm/Cargo.toml @@ -39,4 +39,8 @@ chrono = { version = "0.4", features = ["wasmbind"] } getrandom = { version = "0.2", features = ["js"] } [package.metadata.wasm-pack.profile.release] -wasm-opt = false +wasm-opt = true + +[profile.release] +opt-level = 's' +lto = true diff --git a/bindings/wasm/package.json b/bindings/wasm/package.json index 8f22692bb2..e482c67a51 100644 --- a/bindings/wasm/package.json +++ b/bindings/wasm/package.json @@ -10,11 +10,14 @@ "example": "examples" }, "scripts": { - "build:nodejs": "wasm-pack build --target nodejs --out-dir node && node ./build/node", - "build:web": "wasm-pack build --target web --out-dir web && node ./build/web", + "build:nodejs": "wasm-pack build --target nodejs --release --out-dir node && node ./build/node", + "build:web": "wasm-pack build --target web --release --out-dir web && node ./build/web", + "build-dev:nodejs": "wasm-pack build --target nodejs --dev --out-dir node && node ./build/node", + "build-dev:web": "wasm-pack build --target web --dev --out-dir web && node ./build/web", "build:docs": "node ./build/docs", "build:examples": "webpack --config ./examples/webpack.config.js --mode=production", "build": "npm run build:web && npm run build:nodejs && npm run build:docs", + "build-dev": "npm run build-dev:web && npm run build-dev:nodejs && npm run build:docs", "pretest": "npm run build:nodejs", "prepublishOnly": "npm run build", "serve": "webpack serve",