Npm Esm First In Exports
Codemod verified
Regularly tested and maintained by our engineers and codemod expert community.
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