Skip to content

Commit

Permalink
Add more details to env setup docs (Expo)
Browse files Browse the repository at this point in the history
  • Loading branch information
necolas committed Jan 15, 2025
1 parent 8ea27de commit 48021a0
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions apps/website/docs/learn/02-environment-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function getIsDev(caller) {
}

module.exports = function (api) {
// If not using Expo, set these values manually or by other means
const platform = api.caller(getPlatform);
const dev = api.caller(getIsDev);

Expand Down Expand Up @@ -90,12 +91,25 @@ const projectRoot = __dirname;
const config = getDefaultConfig(projectRoot);
// 1. Enable Metro support for symlinks and package exports
config.resolver.unstable_enablePackageExports = true;
// 2. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`
config.resolver.disableHierarchicalLookup = true;
// 2. Only for npm monorepos: force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`
// config.resolver.disableHierarchicalLookup = true;

module.exports = config;
```
TypeScript-based Expo projects should also set `moduleResolution` to `"bundler"`.
```js title="tsconfig.json"
{
"extends": "expo/tsconfig.base",
"compilerOptions": {
"strict": true,
"moduleResolution": "bundler",
},
...
}
```
## App files
Your app needs to include a CSS file that contains a `@stylex` directive. This acts as a placeholder that is replaced by the generated CSS during builds.
Expand Down

0 comments on commit 48021a0

Please sign in to comment.