Skip to content

Commit

Permalink
chore: optimize binary size
Browse files Browse the repository at this point in the history
  • Loading branch information
ErKeLost committed Jul 25, 2024
1 parent a32cf0e commit b2a7d24
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
19 changes: 14 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
[workspace]
members = [
"crates/*",
"packages/create-farm",
"rust-plugins/*",
]
members = ["crates/*", "packages/create-farm", "rust-plugins/*"]
resolver = "2"

[profile.dev]
codegen-units = 16
debug = 2
incremental = true
panic = "abort"

[profile.release]
codegen-units = 1
lto = "fat"
opt-level = 3
strip = true
panic = "abort"
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"build:cjs": "node scripts/build-cjs.mjs",
"build": "tsc -p tsconfig.build.json && npm run build:cjs",
"build:rs": "npm run build:rs:debug -- --release",
"build:rs:publish": "cross-env CARGO_PROFILE_RELEASE_LTO=fat CARGO_PROFILE_RELEASE_STRIP=symbols CARGO_PROFILE_RELEASE_PANIC=abort CARGO_PROFILE_RELEASE_OPT_LEVEL=s npm run build:rs:debug -- --release",
"build:rs:publish": "npm run build:rs:debug -- --release",
"build:rs:debug": "napi build --platform --cargo-name farmfe_node -p farmfe_node --cargo-cwd ../../ binding --js binding.cjs --dts binding.d.ts",
"build:rs:profile": "cross-env FARM_PROFILE=1 npm run build:rs -- --features profile",
"prepublishOnly": "napi prepublish -t npm && FARM_PUBLISH=true npm run build:cjs",
Expand Down

0 comments on commit b2a7d24

Please sign in to comment.