[英]Node build command not working
I am using this config in package.json file for running webpack dev server. 我在package.json文件中使用此配置来运行webpack dev服务器。 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 npm start
命令工作正常,但构建不是
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 ). 您将不得不使用
npm run build
因为build
是一个内置的内置关键字(请参阅此处的文档: https : //docs.npmjs.com/cli/build )。
Therefore: 因此:
npm build // refers to built in
and.. 和..
npm run build // refers to your script
我想你应该用这个:
npm run build
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.