DEV Community

Create React Project without create-react-app

Vishang on April 26, 2019

Why this post? It's very easy to create react app with terminal by following these commands. npx create-react-app my-app cd my-app n...
Collapse
 
nickfazzpdx profile image
Nicholas Fazzolari

Thank you, thank you, thank you. I was using the create react app npm module and it's too much for what I currently need in my react learning path. I also I like to have a certain degree of control over my app structure.

Collapse
 
vish448 profile image
Vishang

Glad you find it useful

Collapse
 
nickfazzpdx profile image
Nicholas Fazzolari

I'm still new to managing npm modules/packages. I've been thinking about the package.json - One thing I wonder is: Should edits to the package.json be mainly automated through installations and other configuration options invoked or is a lot of time spent manually editing packages.json for config in some cases?

Thread Thread
 
vish448 profile image
Vishang

in my opinion, I would not do that. I will install the libraries as i needed and add --save or --dev-save flags accordingly. So it will added automatically to the package.json file. I am sure you're aware of it. For sure you can add manage it manually if needed. I am not doing it so far as my workflows concerned.

Thread Thread
 
nickfazzpdx profile image
Nicholas Fazzolari

Yeah, just by scrolling through it I got the vibe that it's not common to manually edit. Thanks for replying. :D

Collapse
 
kingtigre profile image
Roger Peixoto Duarte

Good job! Really useful!
I have a question though, how can I access the app from another machine? I know that while using create-react-app it is possible to access is from a adress, but it does not seem to work at the same way when installing webpack manually...

Collapse
 
lologalvez profile image
lologalvez

Awesome step-by-step guide! I bookmarked it a few months ago and came back to it many times since.

There's only one thing missing (no big deal). You don't mention the creation of index.html at any point in the guide (it's listed below with all the files below though).

Collapse
 
mohamadaminataee profile image
Mohamad Amin Ataee

thanks .. it's awesome

Collapse
 
x86chi profile image
Muhun Kim

I think you forgot add html-loader to webpack.config.js. it was didn't loading template without html-loader.

Collapse
 
trisha114 profile image
Trisha Aguinaldo

Thanks for this post! I've used create-react-app as a crutch for far too long. I finally built a react app using your article as a guide. Keep at it!

Collapse
 
vish448 profile image
Vishang

Glad it helps

Collapse
 
ronaldoperes profile image
Ronaldo Peres

Hi,

Very good, may I ask how to make it works in IE11?

I tried to use polyfill but I have no success.

Got this error in IE11: " Object doesn't support property or method 'entries'"

Any idea?

Thanks

Collapse
 
ahmedsaifulla profile image
Ahmed Saifulla N S

Yes, creation of index.html step is not mentioned as well as If you're using webpack-cli 4 or webpack 5, change webpack-dev-server to webpack serve. Otherwise, was great intro to react for me. thanks

Collapse
 
xmelsky profile image
@xmelsky

thanks. this article helped me recap all this react.js stuff!

Collapse
 
lautarolobo profile image
Lautaro Lobo

Wonderful post, you rock dude!!

Collapse
 
lnvns profile image
Lian Nivin

Excellent

Collapse
 
kizero1998 profile image
Kizero1998

Thanks, I always have to remove eslint when ever I use the npx create

Collapse
 
ridhikgovind profile image
Ridhik Govind

Well explained ! Gonna go try this way right now.

Collapse
 
romi_devx profile image
romi_devX

Awesome...thankx for sharing...but i have a question: why did put the "dist" folder in your .gitignore file ?

Collapse
 
vish448 profile image
Vishang

I think every time when you create build it will generate this dist folder automatically.

Collapse
 
snowoner profile image
snowoner

Thx for this post!

Collapse
 
samayo profile image
samayo

Thanks for this. has anyone checked the console, I see an error "Entrypoint undefined = index.html"

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
yousufbasir profile image
gourab yousuf basir

Thanks a lot. ❤❤❤