Skip to content

Commit

Permalink
introduce COPY_TO_TARGET_FOLDER
Browse files Browse the repository at this point in the history
  • Loading branch information
robertherber committed Feb 15, 2025
1 parent 49c60ec commit 47104e9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ The example project is linked specifically to simplify development. This means i

## Prebuild

To try out prebuild functionality (i.e. the config plugin) run `npm run prebuild` in the example project (it uses the `INTERNALLY_TEST_EXAMPLE_PROJECT` env variable to behave like a published package). This should be used to verify changes are expected, but the result should not in it's full state be commited to the example project, since it will break the DX of the example project as explained above.
To try out prebuild functionality (i.e. the config plugin) run `bun run prebuild` in the example project (it uses the `INTERNALLY_TEST_EXAMPLE_PROJECT` and `COPY_TO_TARGET_FOLDER` env variables to behave like a published package). This should be used to verify changes are expected, but the result should not in it's full state be commited to the example project, since it will break the DX of the example project as explained above.
2 changes: 1 addition & 1 deletion config-plugin/withCopyTargetFolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const fs = require("fs");

/** @type {import('@expo/config-plugins').ConfigPlugin<{ appGroup: string; copyToTargetFolder?: boolean }>} */
const withCopyTargetFolder = (config, { copyToTargetFolder = true }) => {
if (!copyToTargetFolder && !process.env.INTERNALLY_TEST_EXAMPLE_PROJECT) {
if (!copyToTargetFolder && !process.env.COPY_TO_TARGET_FOLDER) {
return config;
}

Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"ios": "INTERNALLY_TEST_EXAMPLE_PROJECT=true expo run:ios",
"web": "INTERNALLY_TEST_EXAMPLE_PROJECT=true expo start --web",
"typecheck": "tsc --noEmit",
"prebuild": "rm -rf targets && INTERNALLY_TEST_EXAMPLE_PROJECT=true npx expo prebuild --platform=ios --clean"
"prebuild": "rm -rf targets && COPY_TO_TARGET_FOLDER=true INTERNALLY_TEST_EXAMPLE_PROJECT=true npx expo prebuild --platform=ios --clean"
},
"dependencies": {
"expo": "~51.0.39",
Expand Down

0 comments on commit 47104e9

Please sign in to comment.