Next.js uses the tsconfig of the Next.js app when my package is added to "transpilePackages".
Unanswered
Tan posted this in #help-forum
TanOP
I have a monorepo that contains a few packages and a Next.js app outside of it - in a separate repository (for legacy reasons). I'm not doing any transpilation, so I'm publishing raw TypeScript to the npm registry. When I install one of my packages in our Next.js app, I add it to the "transpilePackages" list in next.config.ts.
It works great during development but when I try to build my Next.js app, the build fails because of TypeScript errors in my package. However, the package builds just fine on itself. The TS configs of my Next.js app and my package are not the same . It seems to me that my Next.js app uses its own tsconfig when transpiling my package. Is there a way to opt out of this? Ideally I'd just share the same TS config, but because of legacy reasons that would be a pretty big job.
It works great during development but when I try to build my Next.js app, the build fails because of TypeScript errors in my package. However, the package builds just fine on itself. The TS configs of my Next.js app and my package are not the same . It seems to me that my Next.js app uses its own tsconfig when transpiling my package. Is there a way to opt out of this? Ideally I'd just share the same TS config, but because of legacy reasons that would be a pretty big job.