webpack-dev-server不是内部命令,然后配置package.json的scipt后
npm run server就可以启动服务器这是为什么?
scripts "scripts": { "test": "echo \"Error: no test specified\" && exit 1", **"server":"webpack-dev-server"** },
下面是我package.json的配置
{
"name": "demo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"server":"webpack-dev-server"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"babel-loader": "^6.4.1",
"css-loader": "^0.28.0",
"style-loader": "^0.16.1",
"url-loader": "^0.5.8",
"webpack": "^2.3.3",
"webpack-dev-server": "^2.4.2"
}
}
不负相思意
相关分类