Skip to content

Instantly share code, notes, and snippets.

@arabold
Last active September 20, 2023 19:54
Show Gist options
  • Save arabold/62acc31f8340282e69799adf313cb75f to your computer and use it in GitHub Desktop.
Save arabold/62acc31f8340282e69799adf313cb75f to your computer and use it in GitHub Desktop.

Add the following scripts to package.json:

    "clean": "npm run clean:git && npm run clean:npm && npm run clean:tmp && npm run clean:android && npm run clean:ios",
    "clean:android": "cd android && rimraf .gradle build && (./gradlew clean --continue || true) && cd ..",
    "clean:git": "git clean -fdX",
    "clean:ios": "cd ios && xcodebuild clean -quiet && rimraf Pods && pod cache clean && pod deintegrate && cd ..",
    "clean:npm": "rimraf node_modules && npm cache clean --force",
    "clean:tmp": "watchman watch-del-all && rimraf '$TMPDIR/react-native-packager-cache-*' && rm -fr '$TMPDIR/metro-cache' && rm -fr '$TMPDIR/haste-map-*'"

Then run npm run clean to perform a deep clean on your React Native project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment