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

176
Views
Vite build: Don't perform typecheck on modules that have been included via the "module" package.json param

I am transitioning my application from Webpack to Vite and I have this custom component library that uses typescript and includes many @types/library-name libraries.

I also have the main frontend repository which I am currently migrating to Vite. It uses this component library.

The problem is that Vite couldn't import this component library at first since there was no "module" property defined in the package.json file of my library. I defined it and pointed it to build/index.ts.

Now, when I include this library from my frontend and perform typecheck using tsc --noEmit, it gives a lot of errors that should've been thrown during the library build, i.e. errors about some modules not being defined, like for example library imports pluralize and during the build of the frontend it throws the following error:

frontend-repo/node_modules/pluralize/pluralize.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/pluralize` if it exists or add a new declaration (.d.ts) file containing `declare module 'pluralize';

How do I make it so that the type resolution for my component library stays local to the library build?

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!