diff --git a/packages/backend/native-utils/Cargo.toml b/packages/backend/native-utils/Cargo.toml index 6f4dd9175..0d2718fd8 100644 --- a/packages/backend/native-utils/Cargo.toml +++ b/packages/backend/native-utils/Cargo.toml @@ -45,3 +45,7 @@ napi-build = "2.0.1" [profile.release] lto = true + +[profile.release-no-lto] +inherits = "release" +lto = false diff --git a/packages/backend/native-utils/package.json b/packages/backend/native-utils/package.json index 2fcc12cd0..3a6bb75f6 100644 --- a/packages/backend/native-utils/package.json +++ b/packages/backend/native-utils/package.json @@ -36,8 +36,8 @@ "artifacts": "napi artifacts", "build": "yarn build:napi && yarn build:migration", "build:napi": "napi build --features napi --platform --release ./built/", - "build:migration": "cargo build --locked --release --manifest-path ./migration/Cargo.toml && cp ./target/release/migration ./built/migration", - "build:debug": "napi build --platform ./built/ && cargo build --manifest-path ./migration/Cargo.toml", + "build:migration": "cargo build --locked --profile release-no-lto -p migration && cp ./target/release-no-lto/migration ./built/migration", + "build:debug": "napi build --platform ./built/ && cargo build -p migration", "prepublishOnly": "napi prepublish -t npm", "test": "yarn cargo:test && yarn build:napi && ava", "universal": "napi universal",