Do I need to use webpack if I use "create-react-app"?

I am working through the JavaScript course and I’m just beginning to work on the Frameworks project (Building the “Library” project using React) and I have a question with the setup.

Previously we were using webpack to bundle multiple files. Now that I am using create-react-app to bootstrap my files, do I still need to do some sort of bundling with webpack? Or does React take care of it for me?

Thanks for you help!

You can use React without Webpack. You will need Webpack if you want to bundle and minify your JavaScript files, and if you want to use Babel to make your ES6 code compatible with older browsers. There could be other reasons why you would use Webpack but those are just the ones could think of. You can technically use Babel and other compilers without webpack but I don’t think most people do that.

Since the material is meant to help us learn React and not how to make a production-ready app I personally wouldn’t bother with webpack, but that’s just me.

1 Like

Appreciate the response! That helps me understand it a lot better!

@J-Haze create-react-app comes with webpack pre-configured. These settings are the most common settings, and you would need to run npm run eject if you want to take over full control of your webpack settings.

1 Like