Several Plasmic projects in one repo

Hi. I’m going to setup several Plasmic projects in one repo. Some of my custom components I want to register for all projects, some of them only for particular project. What is the right way to do this? Can I have multiple plasmic-init.js files? Or maybe register component by condition

Hi @pavel_leskovets, the general setup that works for most teams is to use the same app host for all your projects. This ensures that the registered components you use are consistent across projects. Usually this works for most teams since they only have 1 set of registered components (e.g. design system).

Independently, each app can load multiple projects at the same time (see initPlasmicLoader docs). The app should ensure that it includes all registered components used in those projects. That’s why it’s ideal for each project to use the same app host.

Let me know if that answers the question!

Got it. I can use one app-host for all projects but I cannot use all custom components for each app. Each project is on its own domain. Can I use this information to register components optionally?
Can I use code like this?

You can, but you shouldn’t need to. If a project shouldn’t use custom components, you can not set the custom app host in Plasmic. Then you won’t be able to use the custom components in that project.

In my case I just want to register other components for another app. One part of components for one project, one for another. So If condition works it will be fine for me.

1 Like