Closed michielmetcake closed 6 months ago
@michielmetcake Unfortunately this PR breaks all tests and is the opposite direction of where sindre intended his packages to go, see the FAQ section of https://github.com/sindresorhus/meta/discussions/15
Do you plan to include CommonJS fallback files? No. Node.js 12 supports ESM natively. There's no point.
So reverting to the .cjs format is not an option. If you use imagemin directly, you can do as below for a workaround:
const loadImageminSvgo = await import('imagemin-svgo')
const imageminSvgo = loadImageminSvgo.default
If you depend on a package which expects imagemin-svgo to export a CJS module, you can only insist that the maintainers of the depending package implement this fix or migrate to another CJS-supported implementation.
I would consider adding a cjs
branch which would allow one to do npm i github:imagemin/imagemin-svgo#cjs
, but that would still not solve situations where imagemin-svgo is depended upon by another library.
We're no longer blocked by this. That's why there was no activity in this PR for a while.
Fixes: https://github.com/imagemin/imagemin-svgo/issues/56 and https://github.com/imagemin/imagemin-svgo/issues/51