Files
Shahed Nasser 69b9e73be7 docs: improve commerce modules [1/n] (#9498)
Improve and add docs for API Key, Auth, and Cart Modules

[1/n]
2024-10-11 15:19:13 +00:00

37 lines
822 B
Plaintext

export const metadata = {
title: `Importing from /dist Sub-Path`,
}
# {metadata.title}
Because of how Medusa packages are bundled and released, importing from the `/dist` sub-path of its packages is not allowed.
For example, this is not allowed:
```ts
import {
AdminGetApiKeysParams,
} from "@medusajs/medusa/dist/api/admin/api-keys" // <-- Not allowed
```
## Importing from Exposed Directories
The `@medusajs/medusa` package allows you to import from the following sub-directories:
- `api`
- `subscribers`
- `jobs`
- `core-flows`
- `loaders`
- `commands`
So, you can still import `AdminGetApiKeysParams` from the example above, however, the import path shouldn't include `/dist`.
So, this is allowed:
```ts
import {
AdminGetApiKeysParams,
} from "@medusajs/medusa/api/admin/api-keys" // <-- Allowed
```