Next.js Remove Next Export

This automation dangerously removes all references to the command in *.md, *.sh, package.json.

Next.js
jscodeshift
Estimated time saving
5 minutes/occurrence
Change mode
Assistive
Applicability criteria

Next.js version higher or equal to 13.

Made by
Codemod.com
Codemod.com

Usage →

Codemod CLI:

intalling vs code extension tooltip icon
codemod next/13/remove-next-export
copy CLI command icon

Codemod VS Code extension:

intalling vs code extension tooltip icon
vs code logo
Run in VS Code

Description

The next export command is deprecated. This codemod dangerously removes all references to the command in *.md, *.sh, package.json. It also adds a property output with the value export to the module.exports object in next.config.js files.

Example

Before (Shell files):

npm run next build
npm run next export

After (Shell files):

npm run next build

Before (next.config.js files):

module.exports = {
	distDir: 'out',
};

After (next.config.js files):

module.exports = {
	distDir: 'out',
	output: 'export',
};