It ain't 2021 edition if TypeScript is not configured to emit ES Modules.
The leading JavaScript coder, @sindresorhus
, is switching all the packages to ESM-only.
If you create CommonJS project, you can't import his packages anymore.
The leading JavaScript coder [...] you can't import his packages anymore
Businesses don't care about this at all, not even a little bit.
Dev wants to convert to ES Modules only > manager requests time/cost estimate > dev puts together gigantic list of internal codebases that would have to be converted > manager asks "and all that work only so you can write import x from x, instead of x = require(x) and use packages from your internet hero? No..."
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It ain't 2021 edition if TypeScript is not configured to emit ES Modules.
The leading JavaScript coder, @sindresorhus , is switching all the packages to ESM-only.
If you create CommonJS project, you can't import his packages anymore.
Whatβs a good post from them showing how to configure ESM-only and what does backwards compatibility look like?
I wish I know!
My own library is ESM only since (almost) the beginning, but all my dependencies are either ESM+CJS or CJS-only.
I went through significant efforts making all these things happy:
Now @sindresorhus went ESM-only, and Jest is throwing errors.
Businesses don't care about this at all, not even a little bit.
Dev wants to convert to ES Modules only > manager requests time/cost estimate > dev puts together gigantic list of internal codebases that would have to be converted > manager asks "and all that work only so you can write import x from x, instead of x = require(x) and use packages from your internet hero? No..."