Importing from /dist Sub-Path

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:

Code
1import { 2  AdminGetApiKeysParams,3} 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:

Code
1import { 2  AdminGetApiKeysParams,3} from "@medusajs/medusa/api/admin/api-keys" // <-- Allowed
Was this page helpful?
Edit this page
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break