Skip to content

Commit 6085fd6

Browse files
committed
feat: add a clean script to cleanup build folders
1 parent ccdb618 commit 6085fd6

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/create-react-native-library/templates/common/$package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
"prepare": "bob build",
3434
"release": "release-it",
3535
"example": "yarn --cwd example",
36-
<% if (example == 'native') { -%>
36+
<% if (example === 'native') { -%>
37+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build",
3738
"bootstrap": "yarn example && yarn install && yarn example pods"
3839
<% } else { -%>
3940
"bootstrap": "yarn example && yarn install"
@@ -63,6 +64,7 @@
6364
"@types/react": "~17.0.21",
6465
"@types/react-native": "0.70.0",
6566
"commitlint": "^17.0.2",
67+
"del-cli": "^5.0.0",
6668
"eslint": "^8.4.1",
6769
"eslint-config-prettier": "^8.5.0",
6870
"eslint-plugin-prettier": "^4.0.0",

packages/create-react-native-library/templates/common/CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ By default, the example is configured to build with the old architecture. To run
5050
yarn example ios
5151
```
5252

53+
If you are building for a different architecture than your previous build, make sure to remove the build folders first. You can run the following command to cleanup all build folders:
54+
55+
```sh
56+
yarn clean
57+
```
58+
5359
<% } -%>
5460
<% if (project.architecture === 'new' || project.architecture == 'mixed') { -%>
5561
To confirm that the app is running with the new architecture, you can check the Metro logs for a message like this:

0 commit comments

Comments
 (0)