You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hugo Ruscitti edited this page Dec 23, 2013
·
3 revisions
When you are working on a prototype it's faster to reload the nodewebkit window
automatically on file changes.
To do this, you can add this script tag to the end of your main file:
<script>
var path = './';
var fs = require('fs');
fs.watch(path, [], function() {
if (location)
location.reload(false);
});
</script>
Recursive solution
Sadly, the previous solution don't work recursively. If you want a recursive
alternative, first you need to install "gaze" (with "npm install gaze" command), and
then change the script tag content:
<script>
var Gaze = require('gaze').Gaze;
var gaze = new Gaze('**/*');
gaze.on('all', function(event, filepath) {
if (location)
location.reload();
});
</script>