Is it possible to simply reuse the code of an Ionic app as a webpage?

I’m somehow fixed on the idea of a fit it all responsive HTML+JS+CSS that will be written once and will work for cellphones, tablets and desktops.

I understand it would probably cost a lot of interface tuning to make it perfect in all devices, and it would very likely have to degradate what isn’t possible to display/use in some interfaces.

But I’m trying to find something like Bootstrap that allows me to say declaratively what I want to be shown and what not, I wouldn’t care to have some conditions or different build tasks if needed to build the app for different devices.

Is anyone in here doing something like that? Help me understand if it is possible or not and how yourselves are doing this cross-device strategy to minimize cost/effort/duplication of development.

Thanks in advance!

This is definitely possible, if you are using the ionic (or cordova) CLI you can add a platform called “browser” which is designed to use a cordova app on the web.
This will create a new folder /platforms/browser, add the cordova-browser library and will also add any plugins that support the browser platform

To add the platform
ionic platform add browser
cordova platform add browser

To run it in the browser
ionic run browser
cordova run browser

1 Like