Open JoeGrasso opened 9 years ago
The docs weren't updated to reflect usage.
app.use(require('koa-webpack-dev-middleware')(compiler, {
quiet: true,
noInfo: true,
stats: {
colors: true,
reasons: true,
},
// etc..
}))
app.use(require('koa-webpack-hot-middleware')(compiler));
I have the following code:
var path = require('path'); var koa = require('koa'); var app = module.exports = koa(); var webpack = require('webpack'); var webpackConfig = require('../webpack/webpack.config.dev'); var compiler = webpack(webpackConfig);
app.use(require("webpack-dev-middleware")(compiler, { noInfo: true, publicPath: webpackConfig.output.publicPath }));
app.use(require('webpack-hot-middleware')(compiler));
app.get('*', function(req, res) { res.sendFile(path.join(__dirname, 'index.html')); });
app.listen(3000, 'localhost', function(err) { if (err) { console.log(err); return; }
console.log('Listening at http://localhost:3000'); });
The error is on the "app.use(require("webpack-dev-middleware")(compiler ..."
Any help please.