How to Setup Browsersync for Web Development in Ubuntu?
BrowserSync is an automation tool which is used extensively in web development. This tool makes our testing and tweaking faster by synchronizing file changes and interactions across many devices.
- Features of BrowserSync.
- Live reloading
- Interaction synchronization
- Simulate slower connections
- URL history
- Compatible with task runners like GULP and Grunt
- Work across many operating systems
Working of BrowserSync
BrowserSync is an npm package hence you have to make sure that
Node.js is installed. To install BrowserSync, just open the terminal and execute the following command.
sudo npm install -g browser-sync
To check if BrowserSync is installed, enter the following command.
Go to the root of your project directory run the following command.
browser-sync start --server --files "*.html, css/*.css"
After the execution of the command, it triggers the default browser serving the directories root file.