Simple Hot Reload Server is a command-line utility and Node.js module designed for front-end development, providing a local HTTP server with automatic browser reloading capabilities. It connects clients and the server via WebSockets to enable hot reloading for HTML, CSS, and JavaScript files, among others. Key features include a file viewer, source map preview, and a request forwarding proxy. It also offers a debugger integration. This package is currently at version 1.2.0. While it provides essential development server features, its last significant activity was in late 2021, suggesting it is in maintenance mode rather than active development. Its configuration is typically handled via a CommonJS `hrs.config.js` file, allowing for custom Express middleware and advanced proxy rules.
npm install simple-hot-reload-serverVerified import paths — ran on the pinned version, not inferred.
Demonstrates setting up a `simple-hot-reload-server` with a basic `hrs.config.js` for custom routes and proxying, alongside simple HTML, CSS, and JS files for hot reloading.
For non-HTML/HTM files to trigger hot reloads, configure the `hotRule` option in your `hrs.config.js` to match the desired file extensions (e.g., `/\.(html|htm|css|js)$/`).
Thoroughly test with your target Node.js version and browser environments. Consider alternative, more actively maintained live/hot-reloading development servers (e.g., `live-server`, `browser-sync`) if encountering modern compatibility challenges.
Ensure `hrs.config.js` uses CommonJS syntax (`module.exports = { ... }`). If you need to include ESM-only modules, you might need to use dynamic `import()` within the CommonJS context if your Node.js version supports it.Specify an alternative port using the `-p` or `--port` command-line option, for example: `npx simple-hot-reload-server -p 8083 public`.
If not using `npx`, install it globally: `npm install -g simple-hot-reload-server`. Alternatively, ensure you are running it via `npx` from your project root: `npx simple-hot-reload-server [path]`.
Verify that your `hrs.config.js` includes a `hotRule` that matches the file extensions you expect to hot reload. For instance, `hotRule: /\.(html|htm|css|js)$/` would enable hot reloading for CSS and JS files.
No dependency data recorded yet.