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

155
Views
How can I create a JS library with webpack importing only what is being used?

So, I need to create a npm react components and JS utility library, I'm using webpack but I have 2 problems.

  1. How can I compile the code (react code) and import like import { Component } from 'my-lib'; in a way that the final app only have the code imported and not the rest of the lib content.

  2. Some components/utils inside the library have extra dependencies, but sometimes the final project doesn't need those parts of the lib, and of course, adding those extra dependecies is not needed... But in my lib it says the dependency is needed to be installed in the final project.

I need some guide or start point to take a look.

Thanks!

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