An esbuild plugin that inlines Web Worker code directly into the bundle, eliminating the need for a separate worker file. Version 0.1.1 is stable, with no recent updates. It supports importing .worker.js/.ts/.jsx/.tsx files to get a Worker constructor, bundling the worker code with a separate esbuild build. Unlike worker-loader for webpack, this plugin fully inlines the worker, making it ideal for libraries where worker file management is cumbersome. It ships TypeScript definitions and allows custom esbuild configuration for the worker build.
Verified import paths — ran on the pinned version, not inferred.
ESM-only. No default export in CommonJS; must use dynamic import or build tool that handles ESM.
Worker is a default export from the .worker file, treated as a class constructor.
The argument is directly the esbuild build options object; not nested under extraConfig.
Shows how to use the plugin in an esbuild build and import a .worker.ts file to create an inlined Web Worker.
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.