Skip to content

Latest commit

 

History

History
65 lines (41 loc) · 2.08 KB

README.md

File metadata and controls

65 lines (41 loc) · 2.08 KB

React Native Clean Project

npm version https://img.shields.io/github/license/pmadruga/react-native-clean-project.svg GitHub issues

Cleans your React Native project by purging caches and modules, and reinstalling them again.

Installing

yarn add -D react-native-clean-project

Running

To run on your console, just run:

./node_modules/.bin/react-native-clean-project

Or add it as a script to your package.json

"scripts": {
  "clean": "react-native-clean-project"
}

Content

This is a combination of the commands suggested in the React Native documentation plus others. They are:

  1. rm -rf ios/build (optional)
  2. rm -rf android/build (optional)
  3. watchman watch-del-all
  4. rm -rf $TMPDIR/react-*
  5. rm -rf $TMPDIR/metro-*
  6. brew update
  7. brew upgrade
  8. rm -rf node_modules (optional)
  9. yarn cache clean
  10. yarn install

Command line arguments available for CI's:

  • --remove-iOS-build
  • --remove-android-build
  • --keep-node-modules

Example: ./node_modules/.bin/react-native-clean-project --remove-iOS-build

Other Tips

You can also reset the Metro bundler cache when starting with react-native start --reset-cache

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

  • Pedro Madruga - Initial work and maintenance - pmadruga

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details