Webpack and ReactJS

Hi guys,
I have a project which I created by npm create-react-app, I setup the modules I need, it works totally fine.
But now, I have to add Web Pack to the project.
I read lots of tutorials, adding babel, web pack and react… but none of those work for me.
Could you please let me know how I have web pack in my reactJS project?
Thank you.

Hi nazanin!

I believe create-react-app already comes with webpack preconfigured. They don’t make it easy to override those settings. Have you looked into this thread: https://stackoverflow.com/questions/48395804/where-is-create-react-app-webpack-config-and-files ?

Thanks,
Kirupa

Thank you for your quick reply!
If react comes with pre-configured webpack, how is minimization in building the app?
Does this command “react-scripts build” do the minimization or is there any other way to do that?

When you do a npm run build, the appropriate webpack commands are run to create the minified version of your app. This is in contrast to npm start which is a development build that isn’t optimized for file size and minified.

:slight_smile:

1 Like