Registry / devops / esbuild-hot-reload

esbuild-hot-reload

JSON →
library1.0.6jsnpmunverified

A plugin for esbuild that enables hot module replacement (HMR) during development. Current stable version is 1.0.6, with minimal release cadence. It simplifies setting up live reload for esbuild-based projects, focusing on ease of use with zero configuration. Unlike general-purpose tools like webpack-dev-server, this plugin is tightly integrated with esbuild's API and supports TypeScript out of the box. Requires TypeScript as a peer dependency.

npm install esbuild-hot-reload
INSTALL
IMPORT
SIG · ESBUILD-HOT-RELOAD
E
esbuild-hot-reload
devopsjavascriptv1.0.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

hotReloadPlugin
✓ import { hotReloadPlugin } from 'esbuild-hot-reload'
✗ const { hotReloadPlugin } = require('esbuild-hot-reload')
ESM-only package; require() will fail.
default
✓ import hotReload from 'esbuild-hot-reload'
Default export is the same as named export hotReloadPlugin.
HotReloadOptions
✓ import type { HotReloadOptions } from 'esbuild-hot-reload'
✗ import { HotReloadOptions } from 'esbuild-hot-reload'
Type-only import; runtime import will cause error.

Demonstrates setting up esbuild with hot reload plugin using TypeScript entry point.

import { build } from 'esbuild'; import { hotReloadPlugin } from 'esbuild-hot-reload'; await build({ entryPoints: ['src/index.ts'], bundle: true, outdir: 'dist', plugins: [hotReloadPlugin()], watch: true, }); console.log('Dev server running...');
Debug
Known issues
gotchaPlugin only works with esbuild's watch mode enabled.
fix
Add watch: true to esbuild build options.
affects: >=1.0.0
deprecatedThe plugin does not support custom WebSocket server configurations in v1.0.x.
fix
Upgrade to v1.0.6 or later if available.
affects: 1.0.0 - 1.0.5
gotchaTypeScript peer dependency must be installed even if using JavaScript only.
fix
Run npm install typescript --save-dev.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'esbuild-hot-reload'
Package not installed or path incorrect.
fix
Run npm install esbuild-hot-reload.
TypeError: hotReloadPlugin is not a function
Incorrect import syntax (CommonJS vs ESM).
fix
Use import { hotReloadPlugin } from 'esbuild-hot-reload'.
Error: [plugin: hot-reload] WebSocket connection failed
Browser blocking WebSocket or port conflict.
fix
Ensure no firewall blocking; try changing port.
Upgrade
Version history
1.0.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
esbuild-hot-reload — npm install esbuild-hot-reload · libregistry