npm colorthief 3.4.1

latest release: 3.5.0
3 hours ago

Patch release fixing a bundler warning reported in #283.

Fixed

WasmQuantizer fell back to importing ../../dist/wasm/color_thief_wasm.js when constructed with no arguments, but that file has never been included in the published package. Bundlers resolving colorthief/internals — for example to use oklchToRgb — reported it as an unresolvable module. Applications built and ran correctly (the dead code was tree-shaken away), but every build printed a warning.

The wasm-bindgen glue module is now supplied by the caller:

import { WasmQuantizer } from 'colorthief/internals';
const q = new WasmQuantizer(await import('./pkg/color_thief_wasm.js'));
await q.init();

init() with no module now throws a message pointing at the wasm-pack build step. Neither of the old code paths could succeed from an npm install, so nothing that previously worked has changed.

Thanks to @magic-akari for the report and diagnosis.

Full Changelog: v3.4.0...v3.4.1

Don't miss a new colorthief release

NewReleases is sending notifications on new releases.