CJS => ESM
# yarn
$ yarn esm
$ yarn cjs
# npm
$ npm run esm
$ npm run cjs
ESM
usages
import NextMdx from '@next/mdx'; // ✅
// ...
NextMdx()
OR
import * as NextMdx from '@next/mdx'; // ✅
// ...
NextMdx.default()
CJS => ESM
# yarn
$ yarn esm
$ yarn cjs
# npm
$ npm run esm
$ npm run cjs
ESM
usages
import NextMdx from '@next/mdx'; // ✅
// ...
NextMdx()
OR
import * as NextMdx from '@next/mdx'; // ✅
// ...
NextMdx.default()