DEV Community

Cover image for How to create a React app without using create-react-app | a step by step guide

How to create a React app without using create-react-app | a step by step guide

Ivad Yves HABIMANA on April 18, 2022

Can you set a react project without create-react-app (CRA)? Oh yes, you can! Actually, it's not even that complicated, in this guide, we will creat...
Collapse
 
agamemnun profile image
Bülent T. Yüksel

Thanks for the clear instructions!

Collapse
 
adeodatus profile image
Adeodatus Abdul

Wow!! great work bro

Collapse
 
stuartambient profile image
stuartambient • Edited

Slight change required on my end - in webpack.config.js entry: './index.js'

Collapse
 
ivadyhabimana profile image
Ivad Yves HABIMANA

Actually your version is more correct as we have to specify the path tou our entry file which should be ./index.js. Thanks for mentioning @stuartambient

Collapse
 
nithincp profile image
Nithin Chandran P

Thank you for the wonderful and in-depth explanation.
I apologize for posting this comment a bit late. However, I would like to mention an issue I encountered. I believe that before starting the server, it is necessary to perform the build process, correct? I faced an issue stating 'module not found' initially. However, once I performed the build and then started the server, everything worked fine. Please confirm if I interpreted it correctly.

Collapse
 
ivadyhabimana profile image
Ivad Yves HABIMANA

Hi @nithincp when starting the server by running npm run start or npm start for short it is not necessary to build first. The npm run build command just creates an optimized version of your React code and bundles all your React files (code) into one JavaScript file that is sent to your index.html file, This should have no effect on your development environment.
I don't think it worked because you ran the build command because it should work even without it

Collapse
 
gideonbuba profile image
Gideon Buba

Thank God I found this, I got tired of the boilerplate code when using CRA. Does it also work for typescript?

Collapse
 
ivadyhabimana profile image
Ivad Yves HABIMANA

It would work with a bit more customization to support typeScript. If you want a simpler approach with less boilerplate I would recommend Vite vite.dev/guide/

Collapse
 
timmyjose profile image
Timmy Jose

Beautifully written, and completely approachable for someone new to frontend dev. Great job!

Collapse
 
aman4you profile image
aman4you

Best documentation

Collapse
 
codewithprabhat profile image
codewithprabhat

Wonderful article. Kudos to the Great work