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

188
Vistas
Is there a way to include only one module in the bundle?

I'm building a microservice backend with lerna, parcel and docker. I have multiple microservices, which each rely on some common code in a “commons” package in the monorepo.

This commons package is never published to NPM. Therefore, it works fine in development, but as soon as I try to build the docker containers, the commons module is not available inside the containers.

Is there some way to tell parcel to externalize all dependencies (like it does by default on nodejs) except for the commons package? Is this possible?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can mark a particular package for inclusion in the bundle by using the includeNodeModules option. For example, In the package.json of the project that you want output a bundle that includes commons package rather than simply referencing it, you would have:

{
   "main": "dist/index.js" // Or wherever you want to put the bundle.
   "targets": {
    "main": {
      "includeNodeModules": ["commons"]
    }
  }
}

For bundles that target nodejs (e.g. "library" packages), this option is false by default for every dependency (e.g. all dependencies will be "externalized" except what you put in this list - exactly what you asked for above).

(This assumes you are using Parcel 2+ - make sure you are referencing "parcel": "^2.0.1" not parcel-bundler (which is the deprecated v1 version)).

about 4 years ago · Juan Pablo Isaza Denunciar
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