![]() So in essence, LiveReload does have a way of forcing the client to refresh. I can only assume that whenever the client gets a message about any Pug file being updated, it refreshes. So there's really no way for the client to draw a link between the Pug file that was updated, and the current page that's being viewed. That said, an Express server using Pug is not serving static assets. This seems like a shortcoming in the protocol to me, but I guess it can't be fixed here. From my understanding, the problem appears to be that LiveReload can't directly tell the client to refresh, it can only tell the client which file was updated. However, I really do want restarting the server to cause a refresh in the browser. Usage Start the livereload server: python manage.py livereload keep the livereload server running. Thanks, the suggestion about using LiveReload to update Pug files without restarting the server is really cool. Configuration If you need the livereload server to use a different host and port than the default 127.0.0.9, specify them by setting LIVERELOADHOST and LIVERELOADPORT in settings.py. I'm not saying that livereload should reload on initial connection, but rather when I explicitly request it. ![]() I found #79 (comment), but it seems like what you said there would not be a problem for the setup I'm proposing. It also won't work well because my server startup time might change due to network conditions. Using a hardcoded delay seems like a hacky workaround. Unfortunately, there appears to be no way to do this. To get a refresh when server-side files are changed, it's a simple matter of telling livereload to trigger a refresh of the browser, after my server has started. In my opinion, the right solution to this is for nodemon to start my server which starts a livereload server that only watches the client-side files. When I change server-side files, nodemon restarts my server, and only after the server has restarted can the browser be refreshed. ![]() When I change client-side files, LiveReload can refresh my browser immediately. Download on PyPi Installation Python LiveReload is designed for web developers who know Python. I have client-side files and server-side files. Python LiveReload is an awesome tool for web developers Project description This is a brand new LiveReload in version 2.0.0. ![]()
0 Comments
Leave a Reply. |