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

209
Views
Imports from a lerna shared package seem to require src at the end of the name (Typescript/javascript)

I have a simple lerna project like:

Project
 |    
 +-- packages
 |  |  
 |  +-- shared
 |  |  |
 |  |  +-- src
 |  |       |  
 |  |       +-- index.ts
 |  |       +-- someDir   
 |  |
 |  +-- usesShared
 |
 +

My index.ts has entries like:

export * from "./someDir";

When I import a class from someDir in a "usesShared" class, I am having to put /src at the end of the import like:

import {GreatClass} from "myShared/src";

I am new to Typescript, javascript, & lerna but this seems wrong to me. It seems like it should just be:

import {GreatClass} from "myShared";

Can someone point me towards how to fix this? Does this have something to do with lerna or am I missing something in package.json?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

In "shared" or "myShared" (not sure what you named it), create index.ts:

export * from "./src";

To import the class from usesShared:

import { GreatClass } from "../myShared";
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!