Unverified Commit 6fb98fae authored by Jiwon Choi's avatar Jiwon Choi Committed by GitHub

Transform .mjs files with Next.js codemods (#98029)

### Why?

The shared codemod runner only passed `tsx`, `ts`, `jsx`, and `js` files
to jscodeshift. As a result, config transforms that recognize the
supported `next.config.mjs` format never received those files, leaving
migrations such as `experimental.turbo` to `turbopack` incomplete.

### How?

Add `mjs` to the existing jscodeshift `--extensions` argument. Existing
parser selection and Next.js config detection already support this
format. Unsupported `next.config.cjs` files remain excluded.
parent 0d4dc0c3
...@@ -139,7 +139,7 @@ export async function runTransform( ...@@ -139,7 +139,7 @@ export async function runTransform(
args.push('--ignore-pattern=**/node_modules/**') args.push('--ignore-pattern=**/node_modules/**')
args.push('--ignore-pattern=**/.next/**') args.push('--ignore-pattern=**/.next/**')
args.push('--extensions=tsx,ts,jsx,js') args.push('--extensions=tsx,ts,jsx,js,mjs')
args = args.concat(['--transform', transformerPath]) args = args.concat(['--transform', transformerPath])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment