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?