启动webpack-dev-server报错,如图
文件结构:
├── package.json
└── src
├── index.css
├── index.html
└── index.js
webpack.config.js配置:
let path = require('path');
module.exports = {
entry: {
app: path.resolve(__dirname, 'src', 'index.js')
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist')
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(__dirname, 'src', 'index.html')
})
]
};
package.json的 devDependencies配置:
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "webpack-dev-server"
},
"devDependencies": {
"html-webpack-plugin": "^2.30.1",
"webpack": "^3.8.1",
"webpack-dev-server": "^2.9.2"
}
然后命令行执行npm start就如图报错
米琪卡哇伊
相关分类