Set the DEBUG environment variables to * to see what's going on $ DEBUG=* gulp If the server is not running then this will be undefined. The instance is a "mini-lr" instance that this wraps around. Gulp-livereload also reveals the underlying server instance for direct access if needed. You can also directly access the middleware of the underlying server instance (mini-lr.middleware) for hookup through express, connect, or some other middleware app rver This assumes the page is called index.html, you can change it by providing an optional file path or change it globally with the options reloadPage. You can also tell the browser to refresh the entire page. > NOTE: Calling this function without providing a path will do nothing. You should provide either a simple string or an object, if an object is given it expects the object to have a path property. livereload.changed(path)Īlternatively, you can call this function to send changes to the livereload server. Also you dont need to worry with multiple instances as this function will end immediately if the server is already runing. It takes an optional options parameter that is the same as the one noted above. ReloadPage index.html Path to the browser's current page for a full page reloadĬreates a stream which notifies the livereload server on what changed. These options can either be set through livereload.listen(options) or livereload(options). Livereload = require( 'gulp-livereload') You now have to manually call livereload.listen unless you set the option start: livereload() Gulp-livereload will not automatically listen for changes. Install npm install -save-dev gulp-livereload Just say "no", kids.A lightweight gulp plugin for livereload to be used with the livereload chrome extension or a livereload middleware. But for my money that's the exception rather than the rule. I've no doubt there are situations where live reload is useful. With live reload that usually means I have the noise of a dead application in the corner of my eye as LR obsessively forces the latest brokenness upon me. I've been burned by unsaved changes too many times. That's a problem.įinally, I'm an obsessive 'Ctrl-S'-er. That's so useful and live reload does away with it. Assess, compare and and declare a winner. I have the app of 10 minutes ago sat side by side with the newly adjusted one. I get a screen working one way and then I tweak and play with my implementation. I like to try things out when I'm working. Perhaps a more convincing rationale is how useful it is to have 2 different versions of your app up on screen at the same time. How very dare that
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |