Angular and Realm Web SDK issues

Hello,

I just created a new Angular app using the CLI, added Angular Universal and PWS support. Added Realm-Web and wired it up to my Realm App / MongoDB Atlas Cluster. It seems to work and I can make queries and return data.

I noticed when I build my Angular app for Prod I get a bundle size warning. Keep in mind this app is very bare bones and I only added a few files to get connected to my Realm backend.

Warning: bundle initial exceeded maximum budget. Budget 500.00 kB was not met by 441.48 kB with a total of 941.48 kB.

This is HUGE considering my app only has a couple services and a module added.

Something else I noticed when i build…

./node_modules/realm-web/dist/bundle.es.js:1263:8-27 - Warning: Module not found: Error: Can't resolve 'electron' in '/Users/Jesse/Projects/GCP/BasinsList-Platform/web/node_modules/realm-web/dist'

Given the above error I must ask does the Realm Web sdk support tree shaking? Why is my web app trying to include electron? How much other bloat is getting added to my app bundles?

Thanks.

A couple observations since first post. The Realm-Web SDK obviously does not run on Node which is where SSR takes place. I removed Angular Universal and the electron module not found error is gone. My guess is that when the run time is Node then electron is bundled?

Using a bundle analyzer I don’t see electron included, which is desirable but my bundle sizes are still too large.