typescriptexpopackage.jsonmonorepotsconfig

Why expo/tsconfig.base uses moduleResolution node?


Why expo tsconfig.base uses "moduleResolution": "node" instead for example "moduleResolution": "node16".

I'm asking this because I'm working in a monorepo and I'm creating a shared library with functions to access backend api. My plan was to export every feature separatly using the "exports" package.json option.

for example

// package.json
"name": "@foo/api",
"exports": {
  "./auth": "./src/auth.ts",
  "./config": "./src/config.ts",
  "./user": "./src/user/index.ts
},

But it is not working because of the "moduleResolution": "node".

Should I just export everything from a single file and add only a "main" option or do something else?


Solution

  • Exports are supported since Expo SDK 53. Update to SDK 53 to make tree shaking work.