10

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.

2
  • 2
    create-react-app actually uses webpack, but hides the configuration from the user. You can run npm eject, this will allow you to change webpack config and it won't break your existing setup. Commented Nov 9, 2017 at 21:49
  • 1
    As @dostu said, customizing configuration goes against the Philosophy of create-react-app. Custom configuration requires an eject. This excerpt from the readme explains the reasoning "The feature set is intentionally limited. It doesn’t support advanced features such as server rendering or CSS modules. The tool is also non-configurable because it is hard to provide a cohesive experience and easy updates across a set of tools when the user can tweak anything" Commented Nov 9, 2017 at 21:59

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.