# What changed in earcut

> 15 changes in earcut 3 from its official release notes, upgrade guides and advisories: 3 breaking, 1 new APIs and options. Each one cited. Sources checked 2026-11-30. HTML: https://unstale.sh/npm/earcut/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## earcut 3

### Breaking changes

- The package is published as an ES module and no longer supports CommonJS; use v2.2.4 if you need compatibility. (3.0.0) — [release notes](https://github.com/mapbox/earcut/releases/tag/v3.0.0)
- The legacy UMD browser bundle exposes the main function as `earcut.default`. (3.0.0) — [release notes](https://github.com/mapbox/earcut/releases/tag/v3.0.0)
- Modern ES syntax drops IE11 support; developers can transpile on their end to keep support. (3.0.0) — [release notes](https://github.com/mapbox/earcut/releases/tag/v3.0.0)

### New APIs and options

- Adds a function that refines an arbitrary triangulation, including earcut output, into a constrained Delaunay triangulation, improving triangulation quality at a small runtime and bundle-size cost. (3.2.0) — [release notes](https://github.com/mapbox/earcut/releases/tag/v3.2.0)

### Performance

- Adds a small microoptimization for big input. (3.2.4) — [release notes](https://github.com/mapbox/earcut/releases/tag/v3.2.4)
- Speeds up refine slightly. (3.2.3) — [release notes](https://github.com/mapbox/earcut/releases/tag/v3.2.3)
- Improves refine performance; the reported regression changes from +50% to +38%. (3.2.2) — [release notes](https://github.com/mapbox/earcut/releases/tag/v3.2.2)
- Performance improves by another 6%. (3.1.1) — [release notes](https://github.com/mapbox/earcut/releases/tag/v3.1.1)
- Triangulation of large polygons with holes is significantly faster; the representative fixture drops from ~1000 ms to ~475 ms. (3.1.0) — [release notes](https://github.com/mapbox/earcut/releases/tag/v3.1.0)

### Tooling

- Adds first-class TypeScript types via strict JSDoc. (3.1.0) — [release notes](https://github.com/mapbox/earcut/releases/tag/v3.1.0)

### Fixes and other changes

- Fixes cases where deviation worked incorrectly for zero-area polygons. (3.2.4) — [release notes](https://github.com/mapbox/earcut/releases/tag/v3.2.4)
- Fixes a v3.2 regression that retained more memory than necessary in some cases. (3.2.4) — [release notes](https://github.com/mapbox/earcut/releases/tag/v3.2.4)
- Fixes an edge case that could cause an infinite loop on near-cocircular points. (3.2.3) — [release notes](https://github.com/mapbox/earcut/releases/tag/v3.2.3)
- Fixes cases where refine leaves quads in a non-Delaunay state. (3.2.1) — [release notes](https://github.com/mapbox/earcut/releases/tag/v3.2.1)
- Fixes edge cases where hole self-tangencies could produce incorrect triangulation. (3.1.0) — [release notes](https://github.com/mapbox/earcut/releases/tag/v3.1.0)
