Npm Esm First In Exports
Codemod verified
Official codemod published by a verified account. Learn more.
Sort package.json export order to prefer ESM over CJS
"exports": {".": {"types": "./dist/index.d.ts","require": "./dist/index.cjs", // <-- this would cause platforms to prefer CJS over ESM"import": "./dist/index.js"},}
Example
Before
"exports": {".": {"types": "./dist/index.d.ts","require": "./dist/index.cjs","import": "./dist/index.js"},}
After
"exports": {".": {"types": "./dist/index.d.ts","import": "./dist/index.js","require": "./dist/index.cjs"},}
Build custom codemods
Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community