The hostname to use for the livereload server in the injected SCRIPT tag. For advanced options, provide an object with enable set to true. Note: not all of these options are currently available via the CLI executable Key n, -no-browser do not open the localhost server in a browser Here are the available options: $ livereload help Then you can run the livereload command to serve files out of the current folder. Install the package globally: $ npm install -g gulp-server-livereload If you run gulp webserver your browser should automatically open up to and show a directory listing of the app folder. Var server = require('gulp-server-livereload') The folder supplied to gulp.src() will be the root folder from which files will be served. Installation $ npm install -save-dev gulp-server-livereload Proxy mode - proxy requests arriving at certain URLs to other servers. Supports CSS injection (no need to reload the whole page if just your CSS nsole capture - it can capture console output from theĬlient-side and transmit it to the back-end for display. If your browser does not support WebSockets (PhoneGap developers rejoice!). Uses socket.io - livereload mechanism works even Serve a folder over HTTP and watch it for changes, telling the browser to IN NO EVENT SHALL THE AUTHORS ORĬOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.Gulp plugin to run a local webserver with live reload using socket.io THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. Use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to 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).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |