Hello,
I have been learning React for pretty much last 1.5 months, but all the projects I worked on so far I have managed to do on codepen and intergrated development environments in some courses that I have taken. Right now, however, I would like to build React apps that I could, for example, deploy on Github pages and eventually on my own portfolio website. I came along this package create-react-app and it is recommended as a starting point.
-
As I understand it is a package that already contains setup for creating a standalone React app, like it has Babel and many of commonly used packages preinstalled with it, so we, as users, could simply start coding without a need to setup an app before that. Would it be correct?
-
Also, as I understand, it is something that needs to be installed for each app Iâm working and seems to be taking quite a bit of space. Is it sort of just something that we canât avoid or is there anyway to remove some parts of this package to make our app lighter?
So then after, for example in VS Code, I have done my development and test it through live server, I would build my React app somehow and it will be much lighter?
Right, youâre looking at the dev environment. The âbuildâ folder has the actual build.
Oh yes, thatâs what I was confused about actually. I thought that it would not be really efficient to upload the whole 200+ MB folder on github for each project
But makes sense now. So as I understand now my process of creating React app with help of create-react-app would look similar to that:
- Install create-react-app via npm
- Add any dependencies and packages through my IDE
- Write code and test my project through live server
- Build the project
- Deploy to Github
Yeah, thatâs basically it. In steps 2 and 3, youâre in a kind of fake Node world - holodeck where youâre developing your app. And then when you build it, it minifies and treeshakes and all that other good stuff to make it as small as possible. There are other things you can do to try to keep it small, but donât start worrying until you see what is in the build folder - that is what gets put on your site, the contents of that folder. Everything else is just infrastructure for the holodeck simulation.
1 Like