I'm new to webpack and I'm using webpack dev server for HOT reload.My config looks like this:
new WebpackDevServer(webpack(config), {
publicPath: "./public/dist/bundle.js",
hot: true,
historyApiFallback: true,
proxy: {
'*': {
target: 'http://localhost:3000',
secure: false
}
}
}).listen(8080, 'localhost', function (err, result) {
if (err) {
return console.log(err);
}
console.log('Listening at http://localhost:8080/');
});
and when I start the webpack dev server, I expect it to bundle the js at ./public/dist/bundle.js
as specified. But it doesn't do. However it prints like as if it have done the bundle processing:
Version: webpack 1.13.1
Time: 93044ms
Asset Size Chunks Chunk Names
./public/dist/bundle.js 999 kB 0 [emitted] main
But in my file system bundle.js
is not present.
I could able to make it work by running webpack
first and then calling webpack dev server, which is working as expected!
Where I'm making mistake?