NativeScript

This ideas portal has been deprecated. To submit new feature requests, please follow this guideline

Build apps for Web as well

Will Nativescript build apps for web as well, alongside the mobile platforms it does?

As Ionicframework and similar uses Cordova to build Android and iOS the same code there can be served by an HTTP server to the mobile or desktop browsers.

It would be great to build for Android, iOS, and Web with the same exact code base.

  • Işık FS Can
  • Jun 17 2015
  • Shipped
Link to GitHub issue
  • Attach files
  • Faruk Can commented
    June 17, 2015 19:40

    Nowadays Angular integration is on the way, and using Angular for the mvc kind of things (like data bindings, events etc.) and using Native for the device apis, platform apis and native gui would help in an unequaled way.

    Angular parts can be used in the browser as well when built for it.

    1. What to do with the xml written for the gui templates in Nativescript, they could be converted to proper html for web built of the app, as Nativescript itself already uses a unified gui api for different platforms, that could be possible.

    2. And lastly, native calls made in NativeScript would be ignored in the web build.

    Just tinkering on it. It seems awesome.

  • Ben King commented
    June 20, 2015 22:03

    No, this is not possible. NativeScript is not designed to run in the browser.

  • Valio Stoychev commented
    July 2, 2015 07:40

    It is technically possible to export a {N} app to web or to desktop. But it requires additional plumbing in the framework. Lets see how popular this request will be, because it will require a significant effort from the team.

  • mat taylor commented
    October 15, 2015 17:08

    How much of this could be achieved by defining the standard UI components of nativescript as angular2 web components. 

  • Valio Stoychev commented
    May 11, 2016 07:04

    Please see the aawesome work Nathan Walker did with NativeScript and Angular 2 to allow code reuse. it is on the AngularJS blog - http://angularjs.blogspot.bg/2016/03/code-reuse-in-angular-2-native-mobile.html 

  • Frank Feng commented
    June 7, 2016 05:20

    our company is trying to find out a way to build app once and it can running cross-platform like web and mobile. Or build some components can be used on cross-platform. This may reduce company' cost which means we just need develop once and we do not need two team focus on web and mobile. I don't know if Nativescript can do this cross-platform working.

  • Sergii Starodubtsev commented
    April 13, 2017 13:12

    It must have strategic feature. IMHO but I guess this request is too far in the past by now.