Closed gabrielenosso closed 7 years ago
it depends if you use the shouldKeepAround
option. If you do, then you need to close sketch and reopen it. That being said, if you just change the html or the js of the webview, you can just reload it (right-click -> reload)
I tried the plugin with the 'shouldKeepAround' option set to "false", but Sketch crashes... Sometimes it crashes at the startup, sometimes as soon as I click on the "Get a random number" button.
Also, using 'npm run watch' to start the project, if I change the .html file of the webview and reload it (right-click -> reload), it doesn't show in sketch the new version.
Yeah you need to use shouldKeepAround
if you want to talk to the plugin
So is there a way to have a quick reload of the plugin - or of the webview- using 'shouldKeepAround'? Or closing and reopening Sketch is the only way?
You can setup a webpack dev server and point the webview to it. It’s a bit more work
On 26 Oct 2017, at 15:19, Gabriele Nosso notifications@github.com wrote:
So is there a way to have a quick reload of the plugin - or of the webview- using 'shouldKeepAround'? Or closing and reopening Sketch is the only way?
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
Do you think it would be possible to close Sketch and reopen it?
Using something like: osascript -e 'quit app "Sketch"'
from the Terminal, which soft closes the app.
Oh yeah that’s possible but I think it’s easier to use webpack-dev-server :)
On 26 Oct 2017, at 15:54, Gabriele Nosso notifications@github.com wrote:
Do you think it would be possible to close Sketch and reopen it? Using something like: osascript -e 'quit app "Sketch"' from the Terminal, which soft closes the app.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
but the webpack-dev-server would work only for the webview, not for the plugin. And anyway you would need a way to reload it in Sketch.. no?
Oh yes that’s very true, I’ll try to think about it
On 26 Oct 2017, at 16:05, Gabriele Nosso notifications@github.com wrote:
but the webpack-dev-server would work only for the webview, not for the plugin. And anyway you would need a way to reload it in Sketch.. no?
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
If I change the code, it rebuilds but Sketch doesn't read the new version. I have to close and reopen it to see the modifications.
Is there any step I missed to let it work?