How to view the Cordova application in a browser using Visual Studio?

I want to run the cordova application in a browser (not a ripple emulator, but directly in a browser). I found one way to do this on SO, and it just installed IIS in the www folder. This works very well, but I was wondering if it is possible to add the platform for the browser directly so that it works on F5. I am not very experienced in this, but I have seen that, for example, in raw ionic instruments you can perform "ionic feed" and start the web server and open the browser. In my opinion, it runs node behind the scenes. Is this an easy way to do this in Visual Studio using node or IIs?

+4
source share
5 answers

I don’t think that you can add a “browser” environment to Visual Studio or even native Cordoba. If you really need this functionality, you can use IBM MobileFirst (which I would not recommend if you are not using their server).

I personally do not need the F5 functionality in Visual Studio. Just save, go to your browser and press F5. For debugging, I use Chrome with developer tools.

BTW: I do not configure IIS in the www folder, but in the project folder. I do this because I use TypeScript as a script language. TypeScript files are located next to the www folder. With my setup, Chrome can find the TypeScript source matching the JavaScript code.

+1
source

index.html . → add- > , OK

+1

cordova Visual Studio 2015, Gulp + BrowserSync:

browser.sync NPM. - package.json .

{
  "name": "content_md_app",
  "version": "1.0.0",
  "devDependencies": {
    "gulp": "3.9.0",
    "browser-sync": "2.10.0",
  },
  "dependencies": {
  }
}

gulp, . gulpfile.js . gulp :

gulp.task('browser.sync', function () {
    browserSync.init({
        server: {
            baseDir:"./www/"
        }
    });
    // Note. you can add browserSync.reload to the tasks runner explorer array to make
    // all browsers reload after a build is complete.

});

gulp . enter image description here

+1

, " " . : - . IP-: , , Android ios.

: enter image description here

0
0

Source: https://habr.com/ru/post/1618888/


All Articles