RT webpack-dev-server1换了webpack-dev-server2又不刷新了
版本:webpack-dev-server@2.4.1
命令如下:
"scripts": {
"start": "webpack-dev-server --inline --hot --config webpack.config.js"
},
配置:
entry: {
index: path.join(__dirname, "./src/js/entry1")
},
output: {
path: path.join(__dirname, "./dist"),
filename: "js/[name].js",
chunkFilename: "js/[name].js",
publicPath: "dist/"
},
devServer: {
port: 8080,
host: "0.0.0.0"
},
HTML中的引用:
<script type="text/javascript" src="./dist/js/index.js"></script>
<link rel="stylesheet" type="text/css" href="./dist/css/index.css">
引用改为http的格式也完全无效
好吧--不知道为毛不能加--hot了,把hot删掉就能刷新了。。