Webpack: Change webpack-dev-server Port

Date: 2016-03-25 |

DISCLOSURE: If you buy through affiliate links, I may earn a small commission. (disclosures)

**Problem: **I’m using webpack-dev-server to host my files locally. It’s defaulting to port 8080, but I want to use it on port  number 5000. How can I make webpack-dev-server serve files to ‘http://localhost:5000’?

**Solution: **To change the port webpack-dev-server serves on, use the –port flag.

For example, to have it serve on port 5000 run the following in your project directory:

webpack-dev-server –port 5000

Source: Webpack Documentation

Want more like this?

The best way to support my work is to like / comment / share for the algorithm and subscribe for future updates.