I'm using electron-builder to build a desktop app written in React, one of my dependencies uses realm-js. It builds fine, but the Realm folder in my packaged app's Resources folder is 240MB, pushing my app to a hefty size of 500MB.
@connormakh Did you try to figure out why? And what the content is?
Inside my Resources folder,
realm > vendor > realm-mac-x64 > osx
There are a bunch of .a files:
librealm.a -- 5.8mb
librealm-sync.a -- 2.6mb
librealm-sync-dbg.a -- 59.2mb
librealm-server.a -- 2.3mb
librealm-server-dbg.a -- 60mb
librealm-parser-dbg.a -- 25mb
librealm-parser.a -- 2.9mb
The above seem to be the issue. Is it normal for the file size to be this big?
I wonder why there are debug versions of the binaries and why there is librealm-server.
Not so sure, correct me if I'm wrong, but i think its unnecessary in a production environment for these files to exist
Right, this was more of a question for our JavaScript team 馃槄 We need to figure it out and fix it.
While checking my node_modules, realm folder size is almost 1.09GB. Thats really huge.
I am using it in react-native project and installed it using npm.
Was wondering why such a huge size.
Can we reduce this size?

This might help in the meantime: https://github.com/iotaledger/trinity-wallet/blob/cb5f1df5201a0e1735d06cc229daa85c2533a346/src/desktop/package.json#L81-L86
With these settings, the Mac version of our app turns out to be 223.5MB.
I don't see anything related to Realm in the Resources folder either:
$ ls /Applications/Trinity.app/Contents/Resources
Trinity.icns electron.asar hi.lproj ms.lproj sw.lproj
am.lproj en.lproj hr.lproj nb.lproj ta.lproj
app-update.yml en_GB.lproj hu.lproj nl.lproj te.lproj
app.asar es.lproj id.lproj pl.lproj th.lproj
ar.lproj es_419.lproj it.lproj pt_BR.lproj tr.lproj
bg.lproj et.lproj ja.lproj pt_PT.lproj uk.lproj
bn.lproj fa.lproj kn.lproj ro.lproj vi.lproj
ca.lproj fi.lproj ko.lproj ru.lproj zh_CN.lproj
cs.lproj fil.lproj lt.lproj sk.lproj zh_TW.lproj
da.lproj fr.lproj lv.lproj sl.lproj
de.lproj gu.lproj ml.lproj sr.lproj
el.lproj he.lproj mr.lproj sv.lproj
@connormakh - how did you compile realm?
@trickyc0d3r i was compiling it via electron-builder
In any case, @rajivshah3's solution is what i ended up going with
Most helpful comment
This might help in the meantime: https://github.com/iotaledger/trinity-wallet/blob/cb5f1df5201a0e1735d06cc229daa85c2533a346/src/desktop/package.json#L81-L86
With these settings, the Mac version of our app turns out to be 223.5MB.
I don't see anything related to Realm in the
Resourcesfolder either: