Skip to content

Commit

Permalink
fix(expo): add cacheVersion to metro.config (nrwl#27646)
Browse files Browse the repository at this point in the history
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
expo tends to cache the output if there is no change in metro.config.js
we don't need to explicitly set the args --clear when
expo/expo#30930 is fixed

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes nrwl#27392
  • Loading branch information
xiongemi authored Aug 29, 2024
1 parent f64aa9a commit 925672e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/expo/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function buildExpoTargets(
},
[options.serveTargetName]: {
command: `expo start --web`,
options: { cwd: projectRoot },
options: { cwd: projectRoot, args: ['--clear'] },
},
[options.runIosTargetName]: {
command: `expo run:ios`,
Expand All @@ -116,7 +116,7 @@ function buildExpoTargets(
},
[options.exportTargetName]: {
command: `expo export`,
options: { cwd: projectRoot },
options: { cwd: projectRoot, args: ['--clear'] },
cache: true,
dependsOn: [`^${options.exportTargetName}`],
inputs: getInputs(namedInputs),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const { assetExts, sourceExts } = defaultConfig.resolver;
* @type {import('metro-config').MetroConfig}
*/
const customConfig = {
cacheVersion: "<%= projectName %>",
transformer: {
babelTransformerPath: require.resolve('react-native-svg-transformer'),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const { assetExts, sourceExts } = defaultConfig.resolver;
* @type {import('metro-config').MetroConfig}
*/
const customConfig = {
cacheVersion: "<%= projectName %>",
transformer: {
babelTransformerPath: require.resolve('react-native-svg-transformer'),
},
Expand Down

0 comments on commit 925672e

Please sign in to comment.