...
"scripts": {
"build": "next build",
"start": "next start",
"export": "next export"
}
...
// build command
$ npm run build
$ npm run start
For any prebuild steps, just add the "prebuild" property to your package.json's "scripts" property:
{
...
"scripts": {
"build": "next build",
"postbuild": "node ./path-to/my-prebuild-script.mjs",
"dev": "next dev",
"start": "next start",
"lint": "next lint"
}
...
}