exports

The exports property is a series of entries that tells the CLI about the corresponding entry points of a package in the source code. This is required for resolving imports from external dependencies.

The Omlet CLI follows the same format and convention as Node.js for the exports configuration—except for the conditional exports. The main entry point,import { … } "@acme/design-system", is designated with "."

The exports property should be an object consisting of key-value pairs. The key represents the package export, while the value should be a string that specifies the location of the corresponding source module.

package.json
{
  "name": "@acme/design-system",
  "exports": {
    ".": "./build/index.js",
    "./lib": "./build/lib/index.js",
    "./lib/*": "./build/lib/*.js",
    "./lib/*.js": "./build/lib/*.js",
    "./feature": "./build/feature/index.js"
  }
}

Inaccurate component data?

If you think your component data in Omlet is inaccurate, you might need to set exports and/or aliases. To learn more, check Ensure data accuracy documentation.

Last updated