react-router-tutorial
react-router-tutorial copied to clipboard
Lesson 11 fix.
You output the bundle.js into the folder 'public' so you need to include to proper path in the index.html file now.
@bryanj4 the index.html
file references the script through a relative path currently ./bundle.js
meaning the bundle.js file in the same folder. You may have missed the part of the tutorial that said the index.html
file should also be put into the public folder.
I think the underlying issue that we should fix is that the tutorial tells the student to test out the server before moving the index.html
and index.css
files into the public folder. Simply telling the students to do this before testing would eliminate this problem.
At the moment, after we make the proposed changes of lesson 11, the ones until "Congratulations! You now have a production server...", as bundle.js
is inside /public
, express will return the content of index.html
instead of it.
This issue can easily be avoided by just removing the "In the root directly, go open up webpack.config.js
and add the publicPath '/' as per below:" section.
This looks like a fix for the problems of #218, for which the better solution might be to just not set the public path until after the production server is running. I recommend closing the PR.