Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

471
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda