shellscape/koa-webpack

hot reload don't work

aline2013 opened this issue · 1 comments

When i run entry.js,it always throws new WebpackOptionsValidationError(webpackOptionsValidationErrors); ,it's about plugins, when i remove the plugins, it runs, but hot reload don't work. I also read the webpack-hot-middleware,but it needs plugins, i guess it's noting about plugins 😕
This is my webpack.config.js
`const path = require('path')
const webpack = require('webpack')

module.exports = {
devtool: 'eval-source-map',
entry: __dirname + "/app.js",
output: {
path: __dirname + "/public",
filename: "bundle.js"
},
module: {
rules: [{
test: /.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
'presets': ['es2015']
}
},
{
test: /.css$/,
loader: 'style!css?modules'
},
{
test: /.(png|jpg|gif|svg)$/,
loader: 'file',
options: {
name: 'assets/images/[name].[ext]?[hash]'
}
}
],
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
]
}
}entry.jsapp.use(devWebp({
dev: {
publicPath: config.output.path,
headers: { 'Content-Type': 'text/html; charset=utf-8' },
stats: { colors: true },
quiet: false,
noInfo: true
},
hot: {
log: console.log,
path: '/__webpack_hmr',
heartbeat: 10 * 1000
}
}))` 🙏

from the issue template:

If you proceed with this form, please fill out all fields, or your issue may be closed as "invalid." Please remove this header to acknowledge this message.

Apologies, but you did not fill out the issue template as required and the issue will be closed as invalid. The info you did post is a bit of a mess. Please review Github's Guide on Markdown.