Same code base for Capacitor/Ionic and SPA?

We are currently developing regular Vue SPA with plans to create iOS and Android apps with Capacitor at later date. I have reviewed documentation and multiple tutorials, but it’s still not clear - is it possible to reuse parts of our code for SPA in Capacitor in the same project? Have builds for Vue SPA, iOS, Android in the same project and share part of the codebase?
If yes, any examples would be highly appreciated.

It’s as clear as day in the 3rd paragraph of the introduction docs…

Ionic is the only mobile app stack that enables web developers to build apps for all major app stores and the mobile web from a single codebase. And with Adaptive Styling, Ionic apps look and feel at home on every device.

and there is literally like thousands of examples, all you have to do is search…

It’s funny, I was reading about Capacitor and some Ionic for a solid 3 days and haven’t came across a single example where regular desktop Vue SPA and a mobile/app version share a codebase. Will post example for others when find one. Thanks.

If you would’ve mentioned this in your initial post you would’ve got a different answer.

Yes you can build a desktop + iOS + Android + PWA version of your Vue App and it will all be a single code base (Html, Css and Js).

More Info for desktop platform:

1 Like

The answer for us was - Monorepos.

Here is Ionic doc: Capacitor Configuration | Maintain a Global Configuration File

Is you are new to Monorepos: https://monorepo.tools