gulp - Gulp LiveReload - gulp sass - gulp tutorial - learn gulp
gulp tutorials tag - gulp , gulp sass , gulp watch , gulp meaning , gulp js , gulp uglify , concat javascript , eisi gulp , gulp concat , gulp install , gulp tutorial , what is gulp , npm install gulp , gulpjs
What is Gulp LiveReload?
- Gulp Live Reload plugin is used to identify any changes made into file system. BrowserSync is used to watch all HTML and CSS files in directory.
- When any of the file in the file system is modified, it will reload all url's which have dependency on modified file.
- Live Reload requires the changes in the file system. BrowserSync is used to watch all HTML and CSS files in the CSS directory and perform live reload to the page in all browsers, whenever files are changed.
- BrowserSync makes the workflow faster by synchronizing URLs, interactions, and code changes across multiple devices.
Learn Gulp - Gulp tutorial - Gulp Livereload - Gulp examples - Gulp programs
gulp tutorials tag - gulp , gulp sass , gulp watch , gulp meaning , gulp js , gulp uglify , concat javascript , eisi gulp , gulp concat , gulp install , gulp tutorial , what is gulp , npm install gulp , gulpjs
gulp - Reloading Changes In The Browser :
gulp tutorials tag - gulp , gulp sass , gulp watch , gulp meaning , gulp js , gulp uglify , concat javascript , eisi gulp , gulp concat , gulp install , gulp tutorial , what is gulp , npm install gulp , gulpjs
gulp - webserver :
Installing BrowserSync Plugin
- Time-saving synchronised browser testing
- Checkout the BrowserSync details in the below URL http://www.browsersync.io/
- The BrowserSync plugin provides cross-browser CSS injection and can be installed using the following command.
Learn Gulp - Gulp tutorial - Gulp Browsersync Plugin - Gulp examples - Gulp programs
Usage
Configuring BrowserSync Plugin
- To use BrowserSync plugin, you should write dependency in your configuration file as given in the following command.
- You want to create task for BrowserSync to work with server using Gulp. Since you are running server, so you want to tel BrowserSync about the root of your server. Here, we are using base directory as 'build'.
- You can also inject new styles into the browser using the following task for CSS file.
- Already creating task for BrowserSync, you should install the plugins using package manager and write dependencies in your configuration file as defined in this chapter.
- When you are done with the configuration, run both BrowserSync and watchTask for the occurrence of live reloading effect.
- Instead of running two command lines separately, we will run them together by adding browserSynctask along with the watchTask as given in the following code.
- Run the following command in your project directory to execute the above combined tasks.
Output
- After running the task using the above command, you will get the following result in the command prompt.
- It will open the browser window with the URL http://localhost:3000/. Any changes made to the CSS file will reflect in the command prompt and browser reloads automatically with the changed styles.