-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React web app init #24
Conversation
@@ -62,12 +62,12 @@ | |||
"supertest": "^4.0.2" | |||
}, | |||
"scripts": { | |||
"build": "tsc", | |||
"build": "tsc && (cd ./web && yarn run build)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to clean this up in the future but I don't know enough to know best practices. I found a few variations but pulled some inspiration from this: https://medium.com/codeduck/a-real-world-project-typescript-express-and-react-4701c0458e9c
The gist of it is that we compile the minified typescript and then move that to the /build folder to serve up from the same output as the server.
@@ -38,6 +38,11 @@ Start service (monitors for file changes and sets debug configs) | |||
yarn start | |||
``` | |||
|
|||
To run the web app (auto-served in production): | |||
``` | |||
cd web && yarn start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not super happy with this because it means spinning up two distinct servers when working in dev but the react-scripts people are pretty inflexible about having react-scripts build
produce dev code. Building for production is pretty fast but adding 5-10 seconds to every code change (even when nothing changed on the web app) seemed like a bit much. See: facebook/create-react-app#790
Everything I didn't comment on is either some updates for typescript or generated output from |
No description provided.