Desktop: Fixes #11405: Reduce application size by removing unnecessary Rust files (#11412)

Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
pull/11372/head
pedr 2024-11-28 12:42:25 -03:00 committed by GitHub
parent 0275434077
commit eb5c4606f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 1 deletions

View File

@ -20,11 +20,18 @@ async function main() {
const buildCommand = `wasm-pack build --target nodejs --${argv.profile}`;
await execCommand(buildCommand);
if (argv.profile !== 'release') return;
// If release build, remove intermediary folder to decrease size of release
const removeIntermediaryFolder = 'cargo clean';
await execCommand(removeIntermediaryFolder);
}
// eslint-disable-next-line promise/prefer-await-to-then
main().catch((error) => {
console.error('Fatal error');
console.error('Fatal error', error);
if (error.stderr.includes('No such file or directory (os error 2)')) {
console.error('----------------------------------------------------------------');
console.error('Rust toolchain is missing, please install it: https://rustup.rs/');