Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node build command not working

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

like image 444
h_h Avatar asked Apr 04 '17 13:04

h_h


1 Answers

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
like image 95
AO_ Avatar answered Oct 04 '22 07:10

AO_