October 26, 2024
Chicago 12, Melborne City, USA
javascript

NodeJS how to run one app inside shadow dom of main app?


In my case I’m using vite and react but it doesn’t realy matters could be nextjs. I have my "main app" and "module app" for example chat client. I don’t want to use iframe of "module app" inside "main app" or make static build of "modeule app" and insert it as /public static lib and also I don’t want to merge their components, libs, public files to single app.
Is there solution to use second app as a componet with own dependencies, public, src, tsconfig and so on?
May be like using

<div id="app"></div>
<div id="module_app"></div>

inside index.html or

<div id=“module_app”></div>

somwhere deeper in react app?
And ofcourse shadow root is needed here to escape apps global styles.

The scenario of a question is I have many standalone apps as a web chat, picture editor, accounting documents creator, server monitoring and more, each of them has own git repo. Each of them perfecly works as standalone app and now I need to use some of them as part of main app.



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video