bgrins / TinyColor

Fast, small color manipulation and conversion for JavaScript
https://bgrins.github.io/TinyColor/
MIT License
5.05k stars 439 forks source link

Add esm support #241

Closed bgrins closed 1 year ago

bgrins commented 1 year ago

Will fix #217. It moves the implementation into a mod.js with testing and tooling using Deno (away from Grunt & Qunit). It does keep two UMD files: tinycolor.js and dist/tinycolor-min.js (built via rollup and terser) for backwards compatibilty.

Tested a publish with both CJS and ESM to npm from this into a temporary package at https://www.npmjs.com/package/@bgrins/test-tinycolor-esm & https://github.com/bgrins/test-tinycolor-upgrade. It's not quite working yet due to https://github.com/bgrins/TinyColor/blob/bcfcd1d49181a45fab2dd1858ef22890adba1809/npm/script/mod.js#L50 setting exports.default. Since this isn't using any other dependencies it's likely easier to just manage the publish directly and without the tool.

Todo:

Follow ups

bgrins commented 1 year ago

Closing this in favor of #245