Voa*_*kie 6 javascript webpack webpack-dev-server webpack-hmr webpack-2
我已经建立了一个包含2个条目的Webpack项目.我可以连接到开发服务器,没有错误消息.但是,当我更改其中一个条目文件时,Webpack重新编译(没有任何错误),客户端会注意到并尝试获取JSON,但不存在.连接到dev服务器后,这是完整的日志:
[HMR] Waiting for update signal from WDS...
main.js:20 [WDS] Hot Module Replacement enabled.
2 main.js:20 [WDS] App updated. Recompiling...
main.js:20 [WDS] App hot update...
main.js:20 [HMR] Checking for updates on the server...
main.js:1 GET http://localhost:8080/68003e2dfaa592e9b4dc.hot-update.json 404 (Not Found)
main.js:20 [HMR] Cannot find update. Need to do a full reload!
main.js:20 [HMR] (Probably because of restarting the webpack-dev-server)
Run Code Online (Sandbox Code Playgroud)
我没有重启dev服务器......
这是我的配置:
const path = require("path")
const webpack = require("webpack")
var buildEntryPoint = function(entryPoint){
return [
entryPoint,
'webpack/hot/only-dev-server',
'webpack-dev-server/client?http://localhost:8080'
]
}
module.exports = {
entry: {
main: buildEntryPoint("./src/main.js"),
channel: buildEntryPoint("./src/channel.js")
},
output: {
path: path.resolve(__dirname, "dist"),
filename: "[name].js"
},
module: {
loaders: [{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'react-hot-loader!babel-loader'
}]
},
resolve: {
extensions: ['*', '.js', '.jsx']
},
devServer: {
contentBase: path.join(__dirname),
hot: true,
inline: true,
port: 8080
},
plugins: [
new webpack.HotModuleReplacementPlugin()
]
}
Run Code Online (Sandbox Code Playgroud)
我已经尝试在我的项目的不同文件夹中搜索,看看文件是否存在,但没有运气.Webpack的版本为2.7.0,开发服务器的版本为2.6.1.
这里的问题在哪里,为什么它要求一个不存在的文件?
归档时间: |
|
查看次数: |
410 次 |
最近记录: |