javascriptgrunt-contrib-watch

How to indicate the browser that js file has changed and without refreshing it will reflect on client side. So it downloads the new copy?


when changes occurs in JS file then it will reflect on client side immediately without refreshing and will clear the cache. How can I achieve this? one way is Grunt if you know another another way please let me know


Solution

  • If you use gulp or grunt these are the javascript task runner they watch the js file and if any change in any js file it immediately reload the page

    Gulp

    https://github.com/gulpjs/gulp

    https://scotch.io/tutorials/automate-your-tasks-easily-with-gulp-js

    Grunt

    http://mattbailey.io/a-beginners-guide-to-grunt-redux/