|
1
|
export const metadata = { |
|
2
|
title: `Importing from /dist Sub-Path`, |
|
3
|
} |
|
4
|
|
|
5
|
# {metadata.title} |
|
6
|
|
|
7
|
Because of how Medusa packages are bundled and released, importing from the `/dist` sub-path of its packages is not allowed. |
|
8
|
|
|
9
|
For example, this is not allowed: |
|
10
|
|
|
11
|
{/* eslint-disable @medusajs/import-from-framework-not-internal */} |
|
12
|
|
|
13
|
```ts |
|
14
|
import { |
|
15
|
AdminGetApiKeysParams, |
|
16
|
} from "@medusajs/medusa/dist/api/admin/api-keys" // <-- Not allowed |
|
17
|
``` |
|
18
|
|
|
19
|
## Importing from Exposed Directories |
|
20
|
|
|
21
|
The `@medusajs/medusa` package allows you to import from the following sub-directories: |
|
22
|
|
|
23
|
- `api` |
|
24
|
- `subscribers` |
|
25
|
- `jobs` |
|
26
|
- `core-flows` |
|
27
|
- `loaders` |
|
28
|
- `commands` |
|
29
|
|
|
30
|
So, you can still import `AdminGetApiKeysParams` from the example above, however, the import path shouldn't include `/dist`. |
|
31
|
|
|
32
|
So, this is allowed: |
|
33
|
|
|
34
|
```ts |
|
35
|
import { |
|
36
|
AdminGetApiKeysParams, |
|
37
|
} from "@medusajs/medusa/api/admin/api-keys" // <-- Allowed |
|
38
|
``` |