Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

469
Views
How to point aliases to to different locations based on where it's used on a monorepo

I working on a monorepo project based on Yarn Workspaces with the following structure and I'm wondering how can I use alias with vite to use the same alias name, for example "@composables" to point to a different locations depending on the local repo it's called from. so for example if i have 2 packages the "@composables" should point to "/package-a/composables/" if i used it inside package-a and should point to /package-b/composables/" if i used it in a vue component inside package-b.

I tried using the following but it didn't resolve to the correct location

resolve: {
    alias: [
        { find: '@composables', replacement: './composables.json' },
    ],
  },

And this is the project structure

project-root/
   vite.config.ts
    packages/
        package-a/
        tsconfig.json
            src/
               composables/
               index.ts
            ....
        package-b/
            src/
               composables/
               index.ts
            tsconfig.json
             ...
             ```
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!