I have a react application running on example.com/web, which has menus like register, login, and various other pages mainly static which describe what this app is all about. Now once someone logs in I have example.com/app which opens the application, the dashboard, forms, and again many other things related to the application.
I have set different layouts for example.com/web and exapmle.com/app. and when people visit example.com they are auto-redirected to example.com/web
I have implemented lazy loading for /web and /app.
The problem is when someone visits example.com the serviceworker downloads all the files, which may not be required for people visiting the page only to check about the application.
Now I am looking for something where serviceworker downloads only web components and if required then app components. Maybe something like to break this whole react application into two different applications. I can not remove the serviceworker. I'm also not getting any idea what best can be done to reduce the network call. Do let me know what best can be done. I check a few examples on the subdomain and I think it is again a single react app and serviceworker will download all the files.
And if I break it into two different apps how will I pass authenticated props from the login page which is in /web to /app.
Any help?