Omlet Docs
BlogChangelogAsk the CommunityContact Sales
  • Get started
    • What is Omlet?
    • CLI & Dashboard
  • Omlet for VS Code
  • CLI & Dashboard
    • CLI
      • Your first scan
      • Set up your dashbard
      • Future scans
      • Ensure data accuracy
      • Config file
        • Exports configuration
        • Mapping aliases
        • Excluding certain components & files
        • Tutorial: Config file
      • Custom component properties
        • CLI hooks
        • Tutorial 1: Team/code owner usage
        • Tutorial 2: Package version tracking
        • Other example scripts
      • Set up regular scans
      • CLI commands
        • init
        • analyze
        • login
    • Analytics
      • Popular charts
      • Create custom charts
      • Save charts to dashboard
      • Share charts and dashboards with your team
      • Download chart data
    • Components
      • Search and filter components
      • Component tags
      • Dependency Tree
      • Props tracking
    • Workspace & Account
      • Invite team members
      • Renaming projects
      • Update your email address
      • Access your billing details & invoices
  • Security
    • Security in Omlet
    • Data collection
  • Help
    • Pricing
    • FAQs
      • How detection works?
      • Monorepo support
      • How to delete scans?
      • Omlet vs. React Scanner
      • Working with multiple workspaces
    • Troubleshooting
      • Debugging CLI issues
      • Some components aren't detected
      • API failed or timeout
      • Are you behind a proxy?
      • Troubleshooting Git errors
Powered by GitBook
On this page
  1. CLI & Dashboard
  2. CLI
  3. Config file

Mapping aliases

Make sure to create the .omletrc file in the root directory of your repository before getting started.

If you have alias set up in a tsconfig file or a bundler such as Webpack, Vite, or Babel, Omlet may have trouble resolving import paths from aliases out of the box. Omlet can resolve them if you define these aliases in the config file.

If you have a tsconfig file already, you can simply point to it using the tsconfigPath field:

.omletrc
{
  ...
  "tsconfigPath": "tsconfig.frontend.json"
}

If you have alias setup in a bundler, you can define mapping between your aliases and paths in the aliases field:

.omletrc
{
  ...
  "aliases": {
    "@components/*": ["src/components/*"],
    "@icons": ["src/icons/index.tsx"]
  }
}

If your project is a monorepo with multiple packages, you can define package-specific aliases configurations using the workspaces field. Such as:

.omletrc
{
  "workspaces": {
    "@acme/design-system": {
      "aliases": {
        "@components/*": ["src/components/*"],
        "@icons": ["src/icons/index.tsx"]
      }
    }
  }
}

You can check the Config file documentation to learn more about the aliases property.

PreviousExports configurationNextExcluding certain components & files

Last updated 1 year ago