webpack-dev-server --open启动失败

来源:11-3 构建工具-3

NIA3937244

2019-01-21

报错信息:
Configuration file found but no entry configured.
Use --help to display the CLI options.
——————————————————————————————
安装版本(两个都已全局+本地安装):
webpack-dev-server 2.9.5
webpack 3.10.0
——————————————————————————————
webpack.config.js文件:
const path= require(‘path’); //引用node的path路径对象
const HtmlWebpackPlugin = require(‘html-webpack-plugin’);
const CleanWebpackPlugin = require(‘clean-webpack-plugin’);
module.export={
entry:{
app:’./app/js/main.js’
},
devServer: {
contentBase: path.join(__dirname, ‘dist’),//静态资源输出目录
compress: true,//开启**压缩
port: 9000//服务占用端口号
},
module:{
loaders:[{
test:/.htmlKaTeX parse error: Expected 'EOF', got '}' at position 35: …ml-loader' }̲,{ test:/…/,
loader:‘vue-loader’
},{
test:/.scss$/,
loader:‘style-loader!css-loader!sass-loader’
//多个loader串行解析,顺序从右往左
}]
},
plugins:[
new CleanWebpackPlugin([‘dist’]),
new HtmlWebpackPlugin({
title: ‘Development’
})
],
output:{
filename:’[name].min.js’,
path:path.resolve(__dirname,‘dist’)
//使用node的path路径对象:相对路径,当前路径下的dist
}
}
——————————————————————————————
package.json文件:
{
“name”: “jdtest”,
“version”: “1.0.0”,
“description”: “test”,
“main”: “index.js”,
“scripts”: {
“test”: “echo “Error: no test specified” && exit 1”
},
“repository”: {
“type”: “git”,
“url”: “https://git.imooc.com/lanletter/JDtest.git
},
“author”: “”,
“license”: “ISC”,
“devDependencies”: {
“clean-webpack-plugin”: “^0.1.17”,
“css-loader”: “^0.28.7”,
“html-loader”: “^0.5.1”,
“html-webpack-plugin”: “^2.30.1”,
“node-sass”: “^4.7.2”,
“sass-loader”: “^6.0.6”,
“style-loader”: “^0.19.1”,
“vue-loader”: “^13.6.2”,
“webpack”: “^3.10.0”,
“webpack-dev-server”: “^2.9.5”
},
“dependencies”: {
“vue”: “^2.5.13”,
“vue-router”: “^3.0.1”
}
}
——————————————————————————————
nod版本:v8.9.1
——————————————————————————————
都是尽量还原老师视频中的环境配置的。求助!
查看当前项目依赖包:
查看当前项目依赖包
查看全局依赖包:
查看全局依赖包

写回答

1回答

铁狮子

2019-01-22

这个报错是说你的webpack.config.js没有entry选项,结合webpack文档看下,可以搜下印记中文 webpack

0
0

前端面试项目冲刺 京东金融Vue组件化实战

透过京东金融项目理解组件化思维与项目面试,提升你的综合能力

922 学习 · 309 问题

查看课程