我的配置出了什么问题,它为index.html提供了没有反应输出的功能。使用这个工具几周,有没有更简单的方法呢?
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry:[
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/dev-server',
'./src/index.js'
],
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
},
module: {
loaders: [{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
query:
{
presets:['es2015', 'react']
}
}]
},
resolve:{
extensions :['.js','.jsx']
},plugins: [
new webpack.HotModuleReplacementPlugin()
],
devServer: {
contentBase:'./dist/',
compress: true,
hotOnly: true
}
};