ricokahler/color2k

Bundled outputs

Closed this issue · 1 comments

I recently adopted microbundle for this lib but I think I want to re-evaluate that decision. In the effort of compatibility and control, we'll be going back to manual rollup builds with the following entry points.

{
  "main": "./index.js",      // CJS ES5 compatible bundle
  "module": "./index.es.js", // ESM ES2017 compatible bundle
  "exports": {
    // see here: https://nodejs.org/api/packages.html#packages_conditional_exports
    "import": "./index.mjs", // ESM ES2017 compatible bundle
    "default": "./index.js", // same CJS ES5 compatible bundle
  }
}

There's still some details TBD but the goal is to have legacy compatibility while still not compromising on bundle size.

Additionally, I may explore some CI that generates a bundle size for each export.

cc @ljharb

I'm not even sure there's much benefit from using rollup.