Webpack-dev-server: /webpack-dev-server serves directory listing instead of application

Created on 14 Mar 2015  路  2Comments  路  Source: webpack/webpack-dev-server

http://webpack.github.io/docs/webpack-dev-server.html#hot-mode-with-indication tells me to navigate to localhost:8080/webpack-dev-server, but that URL serves me a very sparse directory listing instead of my application. I have to add a trailing slash and navigate to localhost:8080/webpack-dev-server/ instead to see my application.

Not sure if the docs need to be fixed, or if the slash-free path needs to redirect.

Most helpful comment

Say you wanted to render the index.html under /public in the first place.

Try add configs below into your webpack.config.js:

devServer: {
    contentBase: "./public",
    hot: true
},

And it shall work.

All 2 comments

Docs need to be fixed...

Say you wanted to render the index.html under /public in the first place.

Try add configs below into your webpack.config.js:

devServer: {
    contentBase: "./public",
    hot: true
},

And it shall work.

Was this page helpful?
0 / 5 - 0 ratings