cyrf
cyrf

Reputation: 6023

how to tell webpack to serve public/index.html

When I run webpack-dev-server app/input.js public/output.js and browse to localhost:8080, the browser shows the directory contents of my project folder instead of public/index.html.

How do I tell webpack-dev-server to serve public/index.html?

I am not using a configuration file yet, but will happily do so.

Upvotes: 0

Views: 534

Answers (1)

DonSteep
DonSteep

Reputation: 1075

Use the --content-base flag like so:

webpack-dev-server app/input.js public/output.js --content-base public

See more information at http://webpack.github.io/docs/webpack-dev-server.html#content-base

Upvotes: 1

Related Questions