Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add live reload option to "run mode" #10

Open
charlielee opened this issue May 11, 2020 · 1 comment
Open

Add live reload option to "run mode" #10

charlielee opened this issue May 11, 2020 · 1 comment

Comments

@charlielee
Copy link
Collaborator

It would be very nifty indeed

@lvlirko
Copy link

lvlirko commented Apr 15, 2021

Maybe not the best solution, but it works fine for me.

nw.Window.open(url, options, (win) => {
  win.on("loaded", () => {
    win.show()
  })
})

if (process.versions["nw-flavor"] === "sdk" && process.env.NODE_ENV === "development") {
  fs.watch("src", { recursive: true }, (/*eventType, filename*/) => {
    const nwWindow = nw.Window.get()
    nwWindow.reload()
  })
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants