Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

143
Visualizações
Export multiple NPM packages from single directory

Suppose a Node app which is a "micro-UI". So it has its own UI components, maybe some Redux stuff, some classes to make API calls, etc.

I have need to export some part of this repo for consumption in other micro-UIs:

  • API classes should be exported as my-project-api NPM package.
  • UI things (React router, Redux stuff, UI components, API classes, etc.) should be exported as my-project-ui NPM package.

In other micro-UIs where I need the API classes from this repo (but not the UI components), I'll install my-project-api via NPM.

In the "main UI" project which gathers all micro-UIs and build a single SPA from them, I'll install my-project-ui via NPM.


So, my package.json needs to support publishing multiple package (e.g. the name field needs to be flexible). How can this be accomplished without splitting the API source from the non-API source?

I think the answer is likely to split out the API components / UI components into their own packages in the same repo. But I'm wondering if there's another way.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda