Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
February 25, 2022 08:48 am GMT

Minimal create-react-app

The problem:

When I start a new create-react-app (CRA), it has a lot of files and stuff I don't need. This includes:

  • reportWebVitals(Analytics and performance, etc.)
  • logo.svg and some other stuff to create the React "Hello World" app.
  • setupTests.js, and other test related defaults.Although I might be yelled at for saying: "I don't need testing", I just don't need it for smaller prototype setups.

The solution

When I tried to research for a solution for this problem (fancy way of saying, I googled it), I encountered a post on Stackoverflow, and I am obviously not the only one with this problem, so a guy from CRA (if I remember correctly), commented and mentioned they have developed templates to satisfy users which had a different workflow than the default one.
And that I could find all the templates available on npm, simply by searching for cra-template-*.

Here I found the template I was looking for and can now create my simple and basic CRA Apps, simply by typing:

npx create-react-app my-app --template minimal

Original Link: https://dev.to/vanquard/basic-create-react-app-1g48

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To