reactjs / react-router-tutorial

5.52k stars 1.75k forks source link

Fix typo and readme bug #312

Open ruelasb opened 7 years ago

ruelasb commented 7 years ago

On line 70 the production server can not find the bundle.js file because webpack.config.js pushes the bundle.js into the /public path. The result is a blank page because the server has not been set up with the proper path of /public. The Webpack configuration must be applied after the public directory has been created on line 80 or once the server has been configured to read from the public directory.

ruelasb commented 7 years ago

If it makes it easier to understand I will do some further explanation the changes. Basically when the following instructions are stated in the readme.md file

Now run:
NODE_ENV=production npm start
# For Windows users:
# SET "NODE_ENV=production" && npm start
Congratulations! You now have a production server for this app... 

The server doesn't serve the bundle.js file because at this point we still have not configured the path on the server.js to point to the /public directory.