{"id":25273,"library":"esbuild-debug-tools","title":"esbuild Debug Tools","description":"A tiny helper library (v0.0.10, early stage, monthly releases) that provides a WatchPlugin to monitor esbuild builds and a startDebugServer to run a local debug server with path rewriting. Differentiates by offering zero-config console logging for build results and a simple API proxy to avoid CORS issues. Requires esbuild ^0.19.2, ships TypeScript definitions. No live reload built-in.","status":"active","version":"0.0.10","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install esbuild-debug-tools","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-debug-tools","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-debug-tools","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency for building and bundling; plugin relies on esbuild's build API","package":"esbuild","optional":false}],"imports":[{"note":"ESM-only; use named import. Also works with TypeScript as types are shipped.","wrong":"const WatchPlugin = require('esbuild-debug-tools').WatchPlugin","symbol":"WatchPlugin","correct":"import { WatchPlugin } from 'esbuild-debug-tools'"},{"note":"There is no default export; must use named import.","wrong":"import esbuildDebugTools from 'esbuild-debug-tools'","symbol":"startDebugServer","correct":"import { startDebugServer } from 'esbuild-debug-tools'"}],"quickstart":{"code":"import { startDebugServer, WatchPlugin } from 'esbuild-debug-tools';\n\n// Use WatchPlugin in esbuild context\nconst watchPlugin = WatchPlugin({\n  onStart: () => console.log('Build started'),\n  onEnd: (result) => console.log('Build finished', result)\n});\n\n// Start debug server\nstartDebugServer({\n  debugPort: 8080,\n  htmlPagePath: './dist/index.html',\n  apiPathRewrite: {\n    original: '/api/',\n    alias: 'https://api.example.com/'\n  }\n});\n\nconsole.log('Debug server running on port 8080');","lang":"typescript","description":"Shows how to import WatchPlugin for build hooks and startDebugServer for a local debug server with API path rewriting."},"warnings":[{"fix":"Use a separate livereload plugin or reload page manually.","message":"No live reload: you must provide your own livereload plugin or manually refresh the browser.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure esbuild version meets at least 0.17.10, preferably ^0.19.2.","message":"Requires esbuild >=0.17.10, but peer dependency specifies ^0.19.2. Using older esbuild may cause runtime errors.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Always pass an onEnd handler to silence default logging.","message":"WatchPlugin will print to console if no config is provided; this may be unexpected in production.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install esbuild-debug-tools' and verify import statements use named exports: import { WatchPlugin } from 'esbuild-debug-tools'.","cause":"Package not installed or import path incorrect.","error":"Error: Cannot find module 'esbuild-debug-tools'"},{"fix":"Use named import: import { WatchPlugin } from 'esbuild-debug-tools'.","cause":"Attempted to use default import instead of named import.","error":"TypeError: esbuild_debug_tools_1.WatchPlugin is not a function"},{"fix":"Update esbuild to ^0.19.2: 'npm install esbuild@^0.19.2'.","cause":"Installed esbuild version is too old.","error":"Error: The service is not available (esbuild >= 0.17.10 required)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}