diff --git a/README.md b/README.md index 9a88326..1275196 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/). For a steady stream of TILs from a variety of rocketeers, checkout [til.hashrocket.com](https://til.hashrocket.com/). -_545 TILs and counting..._ +_546 TILs and counting..._ --- @@ -646,6 +646,7 @@ _545 TILs and counting..._ - [Better Module Imports With Aliases](webpack/better-module-imports-with-aliases.md) - [Debugging With Full Source Maps](webpack/debugging-with-full-source-maps.md) - [Run ESLint As A Preloader](webpack/run-eslint-as-a-preloader.md) +- [Specify Port Of CRA's Webpack Dev Server](webpack/specify-port-of-cra-webpack-dev-server.md) - [Use A Specific Config File](webpack/use-a-specific-config-file.md) ## Usage diff --git a/webpack/specify-port-of-cra-webpack-dev-server.md b/webpack/specify-port-of-cra-webpack-dev-server.md new file mode 100644 index 0000000..3310cba --- /dev/null +++ b/webpack/specify-port-of-cra-webpack-dev-server.md @@ -0,0 +1,15 @@ +# Specify Port Of CRA's Webpack Dev Server + +[`create-react-app`](https://github.com/facebookincubator/create-react-app) +gives you a set of scripts, one of which allows you to start a development +server that bundles and serves your javascript. This is handled under the +hood via `webpack-dev-server`. By default it attempts to serve from port +`3000`. If port `3000` is taken it will attempt to connect to another +sequential port. + +Alternatively, you can just specify the port when starting the development +server. This can be done with the `PORT` env var. + +```bash +$ PORT=3333 yarn start +```