I am using this config in package.json file for running webpack dev server. I want to use a build command as well, but its not working for me
{
  "name": "Demo",
  "version": "1.0.0",
  "description": "Demo App",
  "main": "index.js",
  "scripts": {
    "start": "webpack-dev-server --hot",
    "build": "webpack --watch"
},
npm start command works fine, but build isn't
You will have to use npm run build because build is an internal built in keyword (see docs here: https://docs.npmjs.com/cli/build).
Therefore:
npm build // refers to built in
and..
npm run build // refers to your script
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With