kitze / custom-react-scripts

[DEPRECATED, use customize-cra] Allow custom config for create-react-app without ejecting
https://custom-react-scripts.netlify.com
MIT License
993 stars 97 forks source link

how to use this package in an existing create-react-app ? #127

Closed zetekla closed 6 years ago

zetekla commented 6 years ago

how to use this package in an existing create-react-app ? Can I just install it with npm i -S custom-react-scripts-ts and replace react-scripts start with custom-react-scripts start in package.json?

clintandrewhall commented 6 years ago

I’m not at my laptop, but this was something I neede, too. I can post/pull request instructions when I get home... but I was able to by creating a dummy app and comparing my package.json file.

Be sure to blow away any custom .babelrc and your node_modules. I use Flow and my babelrc file ruined everything.

I’ll make a note to add a pull request with my end result.

rafiuske commented 6 years ago

This is simple. In my project, I inserted the "custom-react-scripts": "0.0.23" on package.json, remove react-scripts and run the npm install command. After this, you will need to create the environment file .env in the root and modify the configuration options.

ps.: Make sure that react-script package doesn't exist in your node_modules directory.

ivanberry commented 6 years ago

@rafiuske is need to replace the react-scripts start to custom-react-scripts start in package.json

zetekla commented 6 years ago

@rafiuske I will give it a try and report back! Thank you for your input.

kitze commented 6 years ago

https://github.com/kitze/custom-react-scripts#adding-to-an-existing-project