karma-esbuild is a Karma preprocessor that compiles test files using esbuild, providing extremely fast transpilation and bundling for Karma test runners. Current stable version is 3.0.0, requiring Node >=16, esbuild >=0.17.0, and Karma >=6.0.0. It stands out for its speed and clean output, and supports single-bundle (all tests in one file) or per-file bundling. The package is actively maintained with regular releases on GitHub.
npm install karma-esbuild-upNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic Karma configuration with esbuild preprocessor, custom define, and single-bundle mode for Mocha tests.
Update Node, esbuild, and Karma to minimum versions. Check peer dependencies.
Set `singleBundle: false` in esbuild config to generate a separate bundle per test file.
Migrate custom arguments to esbuild `define` or pass them as plugins.
Use `esbuild` key as shown in documentation.
Run `npm install --save-dev karma-esbuild`.
Ensure `esbuild` key is present in Karma config, e.g., `config.set({ esbuild: { define: {} } })`.Check the plugin implementation and ensure it's compatible with esbuild version.