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

135
Views
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 answers
Answer question

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 Report
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!