aliases

The aliases field allows you to define custom alias configurations that are used by bundlers such as Webpack, Vite, or Babel. If you have a custom alias configuration for your bundler, it's also important to configure it for Omlet.

The aliases property should be an object consisting of key-value pairs. The key represents the alias string used in the codebase, while the value should be an array of strings that specify the location(s) of the corresponding file or files. This structure is adopted from the paths property in tsconfig. For more in-depth information, please refer to the tsconfig documentation on paths.

.omletrc
{
  "aliases": {
    "@utils": ["./src/utils/index.ts"],
    "@components/*": [
      "./src/components/*/index.ts",
      "./src/legacy-components/*/index.ts"
    ]
  }
}

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