At what stage should I run my 'npm run build' script?

nodejs
codedeploy
aws
npm

#1

I’m trying to figure out at what stage I should run my npm run build script that creates dist folder, I was thinking somewhere during my deployment so

deployment:
  # Staging
  staging:
    branch: staging
    commands: - npm run build
      codedeploy:
      ... etc

But I can’t find any confirmation of this, hence asking here


#2

If anyone has an answer to this, I’d like to find out too!

I ran into an error when trying to run npm run build --prefix ./


#3