How to change default port while using webpack dev server

  • Open ‘webpack.config.js’ file.
  • Under devServer add port:’port number’

It will look something like this

devServer: {
historyApiFallback: true,
contentBase: ‘./’,
port:3000
}
  • By default the app will run on port 8080 if you dont mention the port number