Conversation
Cannot use raw paths
gh-pages is served on .../nwhacks2019, which will mess with react-router: react/create-react-app#1765
| .PHONY: serve | ||
| serve: | ||
| @echo Go to http://localhost:8081 to test the built web app | ||
| @(cd ./docs ; python ../serve.py) |
There was a problem hiding this comment.
Can we use http-server instead of the Python script? I know Python 2 & 3 come installed by default on Macs but that's not the case for Windows. After running yarn add http-server -D in web, we can replace line 60 in the Makefile with @(./web/node_modules/.bin/http-server ./docs -a localhost -p 8081 -c-1).
There was a problem hiding this comment.
Ah, I was hoping to avoid installing more npm dependencies, and since we might be using python for mock data filling, I was hoping we could just get the ball rolling here.
If it is a significant inconvenience, I could make the switch 👍
There was a problem hiding this comment.
That would be nice because requiring the user to have Python 2 installed is more of an inconvenience than installing an additional npm package in my mind. Also avoids having to create a new file just for serving the app. Is there a reason why we wouldn't do mock data filling in JavaScript? Imo it would be really nice to stick to one language unless we have a compelling reason not to.
There was a problem hiding this comment.
No reason, one language is a bit boring and I just find python more convenient, and python2 is here because as you mentioned its installed by default on osx. But javascript is fine too.
Fair point on the extra file (though extra npm dependency 😢 ) - i'll make the changes tonight to use the npm package instead
| all: deps | ||
|
|
||
| # List all commands | ||
| .PHONY: ls |
There was a problem hiding this comment.
Woohoo this will be useful!
This is based on #27, that needs to merge first. The diff is really confusing cuz i messed up. Recommend reviewing this commit-by-commit starting at e443e8d
👷 Changes
Saw some stuff in the other PRs where images, assets were
src'd via relative paths, which won't work unless we keep everything indocs/and keep the paths set up right... blah blah it's a bit of a hassle. So we let webpack handle it:this is set in the webpack config:
while I was at it, I did some other adjustments and whatnot to the makefile, and added a script to emulate serving a static web app, just in case webpack-dev-server behaves differently (ie the logo example above)
also added a thing to make sure that react-router works properly with gh-pages based on a ticket I found, but we'll have to keep an eye on if it works. More details in corresponding commit
also bumped dependencies
🔦 Testing Instructions
make build make serve # go to localhost:8081