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

133
Vistas
can't import specific export from main file of library

I am trying to understand how authoring libraries works with webpack and while doing works:

import add from 'sample-lib/add' 

trying to import anything from the main does not:

import { add, subtract } from 'sample-lib'

Here is the repo for your reference: https://github.com/rssilvaba/sample-lib

Any ideas why I can't do that? is it because it is umd? something with my package.json? Am I exporting from main in the wrong way?

Also extra question. how could I re export all files without having to manually add all of the files to the main.js?

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

0

resolved doing:

export { default as add } from './add'
export { default as subtract } from './subtract'
export * from './others'
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