Skip to content

Named exports 🕶

Compare
Choose a tag to compare
@mesqueeb mesqueeb released this 14 Mar 23:57

v2.0 breaking changes

  • only named exports
// before:
import copy from 'copy-anything'

// now:
import { copy } from 'copy-anything'

Reasoning

I was experiencing a lot of problems with just the default export depending on the environment: browser, different versions of nodeJS, rollup/webpack/parcel, ... and also depending on wether the CJS or ESM built file was imported.

Named exports work much more consistently throughout all environments! 🌝