DEV Community

Cover image for Create React App without create-react-app !

Create React App without create-react-app !

Riddhi Agrawal on August 13, 2021

The simplest way to create a basic react app is to run npx create-react-app and boom your basic react app will be created but have you ever wondere...
Collapse
 
michaelcurrin profile image
Michael Currin

For those criticizing the article for not using create app and therefore being slower and less secure.

I think this article is ideal for beginners. It's overwhelming seeing files and how they fit together if you never used React before. And it's easy to forget something if it was generated for you.

I like the explanations going through the set up incrementally and also one will remember things better having actually typed them up or pasted them in a manually created file.

I also like the use of webpack so if you know webpack this is familiar instead of using create React app in script commands.

And when you need to make your second React app to be faster or more secure, then one of always use the creact React app CLI to set up a new project.

Oh also this article uses the latest version of all the packages so security is taken care of there.

Collapse
 
michaelcurrin profile image
Michael Currin

For my projects I like to have a template built around create React app output. Which already has docs and even CI to deploy to GitHub Pages.

Plus it has a bunch of sample components

GitHub logo MichaelCurrin / react-quickstart

Starter template for a React app - including docs, CI, and hosting ⚛ 📦

React Quickstart ⚛️ 📦

Starter template for a React app - including docs, CI, and hosting

GH Pages Deploy GitHub tag License

Made with Node Made with Yarn Made with React

Preview

How to create a new React app

Use this project as a template

Use this template

Documentation

To install, run and deploy the app, see this project's docs:

Docs

To learn how to use this project and see how a React project works, see the Template notes section of the docs.

License

Released under MIT by @MichaelCurrin.

This project is based on the template from the React CLI. I have added my own docs, the deploy flow and made very minor changes to the app.




Oh and if you are curious on how to build and host with no Node, I have this.

GitHub logo MichaelCurrin / react-frontend-quickstart

Starter template using React on a website's frontend - without Node

React Frontend Quickstart ⚛️ 📦

Starter template using React on a website's frontend - without Node

GitHub tag License

dependency - react Hosted with GH Pages

Preview


View site - GH Pages


Use this template

Documentation

View - Documentation

License

Released under MIT by @MichaelCurrin.




Collapse
 
stevesobol profile image
Steve Sobol

I don't like create-react-app. It creates a bloated mess, installs stuff I never use, and fails to install other stuff I always use.

I'm actually using this tutorial to build a template I'm going to push to a private npm repository. It'll save me quite a bit of time once I have everything set up.

Collapse
 
riddhiagrawal001 profile image
Riddhi Agrawal

Thanks for the appreciation and explaining the things really nicely ..!!

Collapse
 
abhishekraj272 profile image
Abhishek Raj

Nice article. Would love to see creating react app with vite.

Collapse
 
riddhiagrawal001 profile image
Riddhi Agrawal

Thanks for the appreciation . Will surely write a post on creating react app with vite .

Collapse
 
swagwik profile image
Sattwik Sahu

If you are gonna write something on Vite, please also include information on how to make a PWA in Vite and deploy it. I've tried making it, but it doesn't work in deployment

Thread Thread
 
riddhiagrawal001 profile image
Riddhi Agrawal

I will make sure to include your point on the article with vite ..!!

Thanks for reading the article and sharing your views ..!

Collapse
 
maxprogramming profile image
Max Programming

Great! I would also recommend checking out Vite for React apps! It's very very much faster than Webpack!

npm init vite
Enter fullscreen mode Exit fullscreen mode
Collapse
 
riddhiagrawal001 profile image
Riddhi Agrawal

I will explore more on vite and will bring articles on that too.

Thanks for reading the article and sharing your views ..!

Collapse
 
alexander89 profile image
Alexander Halemba

I really like webpack, and your how-to is nicely focused on the minimal you need. Thanks for that

But to build a very simple SPA with react, I normally use parcel.

Collapse
 
riddhiagrawal001 profile image
Riddhi Agrawal

Thanks for the appreciation . Will also try to explore more on parcel too .

Collapse
 
webzth profile image
WebDevZTH

I like the article, very clean and to the point. Lean plugins and setup. Although I am wondering will this support HMR (hot module replacement or Fast refresh) with this configuration? Cheers. If not, can you share how to add that functionality. ^_^

Collapse
 
riddhiagrawal001 profile image
Riddhi Agrawal

As for now this doesn't support HMR + Fast Refresh but you can enable that in webpack with some configurations .
You can check this article to enable HMR + Fast Refresh in webpack : dev.to/workingeeks/speeding-up-you...

Thanks for reading the article and sharing your views ..!

Collapse
 
salmannotkhan profile image
Salman Shaikh • Edited

Great tutorial, it gives us somewhat understanding how react works under the hood, but don't you think for beginners parcel.js would be a better way to start instead of webpack because parcel is way more easy to understand than webpack.

Collapse
 
ivan886 profile image
ivan886

hola buen día Agradezco el articulo esta genial. Actualmente tengo dos proyectos uno creado desde cero utilizando webpack y el otro con create-react-app, que ventajas existe al realizar todo desde adicional al aprendizaje?

Collapse
 
jackmellis profile image
Jack

CRA is faster and easier for sure but I still prefer to scaffold my apps manually.

I've worked with devs who had absolutely no clue what to do when hit with babel or webpack issues, because CRA hides all of that detail away.

I feel like a basic understanding of build tools is pretty important for a frontend developer. If you don't at the very least roughly understand what's going on under the hood then you're basically just working with magic...

Collapse
 
drkvogel profile image
Chris Bird

Using npx create-react-app is also best practice, because it is kept up-to-date and will include the latest security patches etc

Collapse
 
riddhiagrawal001 profile image
Riddhi Agrawal

Its the best practice to use npx create-react-app as it makes this long process much more easier and well as keeps the project up to date ..!

Thanks for reading the article and sharing your views ..!

Collapse
 
vetrivel profile image
Vetrivel p

I am beginner in ReactJs.
I have some doubts
Can anyone help me.
Please.

Collapse
 
riddhiagrawal001 profile image
Riddhi Agrawal

Yes you can sure ask your doubts .

Collapse
 
vetrivel profile image
Vetrivel p

I need to create the below project in react, kindly check the below link, if possible please assit.
drive.google.com/file/d/1y3GusfPXD...

Collapse
 
twocs profile image
Tom Anderson

Worked 95%, but needed to change this line of package.json because it complained that mode was not set:
"start": "webpack serve --hot --open --mode development",

Collapse
 
thientanhai profile image
Stephen Dev

I'm a newbie. This is a amazing acticle thanks alot.

Collapse
 
riddhiagrawal001 profile image
Riddhi Agrawal

Thank you so much for the appreciation .

Collapse
 
kanade_sourabh profile image
Sourabh Kanade

Nice

Collapse
 
riddhiagrawal001 profile image
Riddhi Agrawal

Thanks for the appreciation.

Collapse
 
arogya01 profile image
arogya bichpuria

brilliant, got to explore how create-react-app is doing, what it is doing. Thank you.

Collapse
 
riddhiagrawal001 profile image
Riddhi Agrawal

Thanks for the appreciation and sharing your views ..!! : )

Collapse
 
ryannerd profile image
Ryan Jentzsch

Great article! Thanks for spending the time to share it with us. It would be interesting to see this but with support for TypeScript.

Collapse
 
riddhiagrawal001 profile image
Riddhi Agrawal

Thanls for the appreciation . Will surely write an article with Typescript support .

Collapse
 
aderchox profile image
aderchox • Edited

Thank you. For those who want to know about what Webpack and Babel do in more depth and how they're useful, read this article: blog.jakoblind.no/babel-preset-env/

Collapse
 
pinksynth profile image
Sammy Taylor

This is an excellent article. Thanks so much!

Collapse
 
matanelgordon profile image
MatanelGordon

where is the linter?

Collapse
 
riddhiagrawal001 profile image
Riddhi Agrawal

As it was a very basic app i haven't added Linters , but you can always customize your project.

Cheers.!

Collapse
 
muhammadshahidhanif profile image
Muhammad Shahid Hanif

Hi, firstly thank you for introducing amazing ideas and platforms with us. I really enjoy your work and the way you make it so interesting makes my focus and concentration intact.

Collapse
 
trezeguit profile image
Mahmoud Hassan

awesome article thanks for your efforts.
I think you forget (webpack-dev-server), the app doesn't run without it

Collapse
 
riddhiagrawal001 profile image
Riddhi Agrawal

Thank you so much for the appreciation and correction . Will surely edit the post right away.

Collapse
 
utkarshkalra profile image
utkarsh

This is really helpful for understanding react better

Collapse
 
sandeepan23 profile image
Sandeepan Mahapatra

Great article Riddhi! Love to see more articles from you!😃

Collapse
 
riddhiagrawal001 profile image
Riddhi Agrawal

Thanks for the appreciation . Will surely write more articles in future .

Collapse
 
riddhiagrawal001 profile image
Riddhi Agrawal • Edited

The whole point of writing the article was to know the background process as well as benefits of using npx create-react-app .

Thanks for reading the article and sharing your views ..!

Some comments have been hidden by the post's author - find out more