npm run build production does not distribute the production

You could also use -- to separate the params passed to npm command itself and params passed to your script. So the correct syntax for your case would be:

npm run build -- --prod

npm run build should have the script in the package.json have a look there and maybe add the line in the scripts

{
...
 scripts: {
    "build": "ng build --prod"
 },
...
}

this should do the trick


What you can do is update the build script in the package.json as

scripts:{
   "build": "npm run ng build --",
   "ng": "ng"
}

-- allows you to pass arguments to a script.

Then you can pass the arguments to ng build like ng build --prod