0

I have multiple postbuild scripts inside on my Next.js project package.json file.

"scripts": {
    "dev": "next dev",
    "build": "next build",
    "postbuild": "node ./src/scripts/build-algolia-search.js",
    "postbuild": "next-sitemap",
    "start": "next start",
    "test": "jest"
  },

I am getting a Duplicate object key warning. Will this work? If not, how can I add both of the scripts?

Benjamin Carlson
  • 295
  • 3
  • 13

1 Answers1

1

After a bit of researching I found this: How can I run multiple npm scripts in parallel?

Basically you can add && or & to run them sequentially or in parallel (in that order). For my example:

"postbuild": "next-sitemap & node ./src/scripts/build-algolia-search.js",
Benjamin Carlson
  • 295
  • 3
  • 13