Adding Webpack to existing React app

Viewed 5835

So I have built the first piece of an app using create-react-app. It by default is using npm for building, running locally, etc...

What I want to do is to move to using Webpack, but not breaking the existing setup and have done some googling, but nothing starts and goes step by step so I can get a better feel for what it is doing and where it is going. Would like to also incorporate using webpack-dev-server with this as well.

That said, I was hoping you guys had some recommendations and maybe also point out some good tutorials for this moving forward?

Thanks much.

1 Answers

Create react app uses Webpack. If you want to modify Webpack.config for this project you can run yarn eject/npm eject from here on you are responsible for the Webpack.config so it will be harder to update react scripts.

If you don't want to be responsible for the Webpack.config you could try to use react-app-rewired.

Related