如何清理我的 react-native 项目以进行备份? [英] How can I clean my react-native project to back it up?

查看:27
本文介绍了如何清理我的 react-native 项目以进行备份?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 React-Native 开发一个移动应用程序,由于我是它的唯一开发者,我不想使用像 git 这样的版本控制工具,我不想将它托管在云上(信任原因...),并且想知道如何备份我的 react-native 项目,以防硬件丢失.

I'm developing a mobile app using React-Native, and as I'm the only developer of it, I don't want to use a versioning tool like git, I don't want to host it on the cloud (trust reasons...), and was wondering how can I make backup of my react-native project, in case of an hardware loss.

显而易见的方法是将所有内容存档,但压缩后重量为 2.2GB,约 800MB.一个备份没问题,但如果我想定期备份怎么办?

The obvious way would be to just archive everything, but it weight 2.2GB and about 800mb once compressed. It's ok for one backup, but what if I want to make regular backups?

推荐答案

清理

使用 xcode 项目清理派生数据

To clean

Clean deriveddata with xcode project

cd ios
xcodebuild clean

清理 ios 构建文件夹

Clean ios build folder

rm -rf ios/build

清理 ios pods

Clean ios pods

rm -rf ios/Pods

干净的安卓工作室

cd android
./gradlew clean

清理安卓构建文件夹

rm -rf android/build
rm -rf android/app/build

清理 gradle 缓存

Clean gradle cache

rm -rf android/.gradle

清理节点模块

rm -rf node_modules

清理守望者缓存

watchman watch-del-all

清理 npm 缓存

npm cache clean

您现在可以存档所有内容!

You can now archive everything!

重新安装 package.json 的 npm 模块

Install back package.json's npm modules

npm install

重新安装 iOS Pods

Install back iOS Pods

cd ios/
pod install

这篇关于如何清理我的 react-native 项目以进行备份?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆