Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more details to env setup docs (Expo) #259

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading