Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

esbuild-plugin-istanbul

abraha2d1.6kMIT0.3.0TypeScript support: included

An esbuild loader that instruments code with istanbul/nyc.

readme

esbuild-plugin-istanbul

An esbuild loader that instruments code with istanbul/nyc.

Usage

import { esbuildPluginIstanbul } from "esbuild-plugin-istanbul";

const jsPlugin = esbuildPluginIstanbul({
  filter: /\.[cm]?js$/,
  loader: "js",
  name: "istanbul-loader-js",
});

const jsxPlugin = esbuildPluginIstanbul({
  filter: /\.jsx$/,
  loader: "jsx",
  name: "istanbul-loader-jsx",
});

const tsPlugin = esbuildPluginIstanbul({
  filter: /\.[cm]?ts$/,
  loader: "ts",
  name: "istanbul-loader-ts",
});

const tsxPlugin = esbuildPluginIstanbul({
  filter: /\.tsx$/,
  loader: "tsx",
  name: "istanbul-loader-tsx",
});

await esbuild.build({
  plugins: [jsPlugin, jsxPlugin, tsPlugin, tsxPlugin],
});

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

[0.3.0] - 2023-10-17

Fixed

  • Interoperability with JS
  • Usage documentation

[0.2.1] - 2023-10-17

Fixed

  • Incorrect NYC initialization

[0.2.0] - 2023-10-17

Added

  • Ability to specify a custom loader to be used prior to instrumentation
  • This changelog

[0.1.2] - 2023-10-17

Added

  • Project metadata for npm

[0.1.1] - 2023-10-17

Fixed

  • Missing .d.ts on npm

[0.1.0] - 2023-10-17

  • Initial release