Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

nextjs run command before build

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"
  }
  ...
}
 
PREVIOUS NEXT
Tagged: #nextjs #run #command #build
ADD COMMENT
Topic
Name
9+8 =