HMR is a lightweight tool that updates your browser in real-time without requiring a page refresh.
When working on projects that do not use UI libraries like React or Vue—which come with built-in Hot Module Replacement—developers often miss out on the benefits of live updates. While tools like browser-sync offer similar functionality, they can be resource-intensive and heavy on system memory. HMR was created as a lean alternative to speed up development by instantly reflecting UI changes without the overhead.
- Clone the repository:
git clone https://github.com/Abdallah-Abdelrahman/HMR.git
- Navigate to the project directory:
cd HMR - Install dependencies:
go mod tidy
- Build the static binary:
make build-static
- Create a symlink to the binary:
sudo ln -s <project-absolute-path>/bin/hmr /usr/local/bin/hmr
- Run HMR from anywhere:
hmr <path-to-directory-containing-html|css|js-files>
- Embed the client-side script:
Include this script in your HTML file to enable live updates.
