Registry / web-framework / esbuild-plugin-dev-server

esbuild-plugin-dev-server

JSON →
library4.2.10jsnpmunverified

Dev server plugin for esbuild that provides live reload and error overlay. Current stable version is 4.2.10, released on npm with frequent updates. Key differentiators: integrates directly with esbuild's build process, supports Express and Electron examples, provides built-in error overlay for development. Requires Node >=18. Ships TypeScript types.

web-frameworkdevops
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.

Package is ESM-first; CommonJS require works but is deprecated. Use import for best compatibility with modern JS/TS.

import devServer from 'esbuild-plugin-dev-server';

TypeScript users should import type using `import type` for the options interface; it's not a runtime value.

import type { DevServerOptions } from 'esbuild-plugin-dev-server';

Plugin is a named export for type checking; using require to destructure is incorrect as it's a type export.

import devServer, { Plugin } from 'esbuild-plugin-dev-server';

Sets up a basic esbuild build with the dev server plugin serving static files from './public' on port 3000.

import esbuild from 'esbuild'; import devServer from 'esbuild-plugin-dev-server'; await esbuild.build({ entryPoints: ['./src/index.js'], bundle: true, outfile: './public/bundle.js', plugins: [devServer({ public: './public', port: 3000 })], });
Debug
Known footguns
breakingIn v4.0.0, the plugin signature changed from `devServer()` returning an esbuild plugin object to `devServer(options)` that must be called directly in the plugins array.
breakingNode <18 is no longer supported in v4.0.0+. Older versions may fail with syntax errors.
gotchaThe dev server does not automatically open a browser. You must configure that yourself if needed.
deprecatedUsing CommonJS `require()` to load the package is deprecated in favor of ESM `import`.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
9 hits · last 30 days
gptbot
3
ahrefsbot
3
claudebot
3
Resources