user2422960
user2422960

Reputation: 1526

How do you conveniently (manually) test your node-webkit applications?

I would like to develop an application using node-webkit, making use of the possibility to use node modules on the front-end.

I find it somewhat annoying to rebuild the application after every couple of changes and would rather test in a browser with convenient stuff like livereload etc. However, I would have to utilize browserify in order to do so, which would lead to a bulk of files I would have no use for in the actual application.

How do you test your nw apps? Is there a common workflow?

Upvotes: 0

Views: 132

Answers (1)

OldGeeksGuide
OldGeeksGuide

Reputation: 2918

You shouldn't have to build your node-webkit app to test it. If you use the node-webkit application on the command line and pass the root directory of your app (containing package.json) then it should start up as though you built it. If you also leave toolbar true (i.e. "toolbar": true under window in package.json) then you'll have a URL bar including a reload button, so you could just hit that when you want to restart.

On Windows or Linux, if you're in the root directory on the command line, with nw in your path, it would look like this:

nw .

On a Mac, you'd need to put nodewebkit in your path, which is buried in the node-webkit.app, for example you could do this:

alias nw='node-webkit.app/Contents/MacOS/node-webkit'

though you'd probably want to prefix it with the full path to node-webkit.app

There's probably a way to do live reload, but I'm not sure how best to approach that offhand.

Upvotes: 1

Related Questions