Server rendering template, how to hot update the front end

the server uses koa , uses pug template engine, and renders the template in the way of ctx.render ("layout", data) ). How to refresh the front-end page automatically after changing the front-end pug , less , js files?


how to automatically refresh the front-end page after changing the front-end pug, less, and js files?
  1. automatic updates and hot updates are not the same problem.
  2. this is not just a front-end automatic update problem, the template data must follow the back-end data. So the problem becomes how to update the front and back end automatically.
  3. you can use gulp to monitor files, gulp-nodemon to automatically restart the backend, and gulp-livereload to automatically update the front end.

have you seen this technology anywhere else? Update the static file in real time after modification. That's not about asking for static files all the time.

Menu