Multiple apps under one project using different configurations


I’m using Ionic 3, Angular 5.

I’d like to define multiple apps under one project. This is something that can be done in Angular, see for example. Therefore, I expect this option to be available also in Ionic 3, yet I didn’t find a way to do it nor a source to demonstrate how to do it.

Is this possible? How can I achieve this purpose?


What are you wanting to achieve exactly?

What is it you wish to share? Backend code? Components?

Under different apps, I’d like to load different components for the same pages.

For example, saying I have a “LoginPage” that I’d like it to use a certain login component. This component should be “smsAuthComponent” for one app, and “credComponent” for another.
I was told it is achievable by defining those different components (or the one that import them) in a config file.

How can this be achieved?

I’ve literally just knocked this up but you should get the idea.

Created a component in the ‘shared’ ionic project, imported the components.module.ts into the ‘First’ and ‘Second’ ionic projects and added to home.html in both of those.

Interesting, though I can’t access/open the “Shared” folder.

So if I get you right:
You’ve created 2 different Ionic projects, each has their own components. In addition, they import a module of shared components in their app.module.ts file ([“First” or “Second”]/src/app/app.module.ts) ?

Is it the only way to achieve this? Isn’t there a way to make this work under 1 shared project, that changing configurations in one of its files (manifest.json [project/src/manifest.json], config.xml, ionic.config.js,or other file) will produce similar or the same behavior? i.e. Having 2 different apps under 1 project, varying in their components - depending on project configurations?


1 Like

I’m sure there’s more than one way to do this, but this is my potential approach.

There’s nothing you can’t share between such as pages, components, providers, and it’s a much cleaner approach instead of mangling two apps into a single folder.

It’s entirely up to you what you decide upon, this is simply an approach to keep it clean.

I’ll take a look at why those other folders are not available, think I’ve not checked it in right.

Ok. Thanks for the help.

If should all be there now on the repo. Try a git pull to see if you can see it all.