Browser-Sync¶
Browser-Sync is a development tool designed to automate the browser refreshing process during web development.^[600-developer__tools__browerHotReload.md]
It is particularly useful for projects using server-side technologies like JSP, as it enables the page to reload automatically whenever code changes are detected, saving the developer from manually refreshing the browser.^[600-developer__tools__browerHotReload.md]
Usage¶
Browser-Sync typically operates by creating a proxy server that forwards requests to the local development server.^[600-developer__tools__browerHotReload.md]
The following command demonstrates how to initiate Browser-Sync for a project located at localhost:8080/oneShop, watching for changes in CSS, JS, and JSP files^[600-developer__tools__browerHotReload.md]:
browser-sync start --proxy "localhost:8080/oneShop/" --files "**/*.css, **/*.js, **/*.jsp"
Once the script is running, the application can be accessed via a new port (e.g., http://localhost:3000/oneShop), and modifications to frontend files will trigger an automatic reload.^[600-developer__tools__browerHotReload.md]
Sources¶
- 600-developer__tools__browerHotReload.md
Related¶
- [[Hot Module Replacement]]
- [[Development Workflow]]
- [[Proxies]]