Hi guys, I wanted to create a React App with create-react-app. Unfortunately I wasn’t able to install the package globally and couldn’t use it.
It would be nice if somebody got this default app working, for requirements check this post from Dan:
One other thing that would be nice to have in this regard would be to push the build folder (or any other configurable folder) directly to the gh-pages branch in github so we can use github hosting but edit our websites here.
I have a related question—did something change in how you handle restarts? There used to be an issue where npm start would get killed on every file change, leading to very slow rebuilds, but it appears fixed now. Curious if this was fixed intentionally, and what is the heuristic Glitch uses to choose whether to kill the process or not.
We provide the ability to remix projects, so a suggestion for now while we consider your feature request would be to create a create-react-app template app on Glitch, which includes a watch.json and whatever setup you recommend, which your users could use. You can link to the remix app directly from your docs and we’d be happy to feature it on our community site too.
Also does this support auto reloading as the create-react-app local?
One more thing, I know glitch is for dev mode, so is that why we cannot directly copy paste the build folder assets here? Exceed the storage limit or something? I saw it crashed by doing this.
If the build folder exists on the container then you can programmatically read/write to and from it, even if it’s not shown in the file tree. There’s more about that here: https://glitch.com/faq#hidden-files. You can also use the console to interact with it, which is available under Advanced Options from the top-left project info menu.
You can add a watch.json file to your project to change the Glitch restart behaviour, if you want to make use of create-react-apps reloading. There’s one already in the referenced sample app and more detail about how to use it here: https://glitch.com/edit/#!/watch-json
If you prefer to deploy your production app to GitHub Pages instead, another option besides what has been already shared is automatically renaming build to docs, exporting to GitHub and merging the glitch branch to master. Here’s another boilerplate with instructions in the README: https://glitch.com/~create-react-app-ghpages-demo