DEV Community

create-react-app or Custom Webpack config?

Slick3gz on January 17, 2019

Been working with React/Redux over the past month or so. Last night, I was finishing up a streaming app that uses Node Media Server and ran into a ...
Collapse
 
ceckenrode profile image
Christian Eckenrode

Create react app has some really sensible defaults that are great for most react apps and how I think most people set up their projects. If you think messing with the webpack config is the answer, you could always eject on a branch, try that out, and then just throw the branch away if that isn’t the answer?

Collapse
 
slick3gz_ profile image
Slick3gz

Version Control to the rescue! πŸ¦Έβ€β™‚οΈ

Collapse
 
dance2die profile image
Sung M. Kim

If you need to override some settings, you can use React-App-Rewired.

You don't have full control and it's not recommended.

By doing this you're breaking the "guarantees" that CRA provides. That is to say you now "own" the configs. No support will be provided. Proceed with caution.

"Stuff can break" β€” Dan Abramov https://twitter.com/dan_abramov/status/1045809734069170176

For simple pages, I just create a new webpack config using Webpack config tool, which lets configure webpack online.

Collapse
 
nguyenman999 profile image
nguyenman999

You eject react-create-app to add your customize Webpack config: facebook.github.io/create-react-ap...

Collapse
 
slick3gz_ profile image
Slick3gz

My problem ended up not being CORS at all. πŸ™„ I forgot to append β€œ.flv” to the end of the url in my createPlayer function πŸ€¦β€β™‚οΈ Those lovely errors that send you off into the void.