https://github.com/Exeteres/nuxt-issue
I want to use two tsconfig.json. One for backend at the root of the project and one for nuxt in src/ui. I expected that nuxt will use rootDir option from nuxt.config.js
Nuxt created tsconfig.json at the root of the project, but uses tsconfig.json from src/ui, which does not exist.

I think I found a code fragment, which contains a bug
https://github.com/nuxt/nuxt.js/blob/e5369db2d539cf580e9ce609e895c67bc01c9b3c/packages/cli/src/command.js#L93

@Exeteres
About tsconfig.json, it won't be overridden anymore in nuxt/nuxt.js#5367
For the rootDir thing, the issue is that if the user is using a nuxt.config.ts, we need to register ts-node before reading it to successfully read it, and we can't know rootDir before reading it, that's why we use the tsconfig.json found where nuxt is run for now.
I don't have clues for now to handle this, I'll need to take more time to see if a solution really can be found, even if I already spent lot of time looking for one. So if you got any idea I'm all ears :)
@Exeteres , further notes :
Nuxt will always look for the tsconfig.json in same folder as nuxt.config.js (or nuxt.config.ts) to initialize TypeScript support. You can then configure the forkTsCheckerWebpackPlugin (which is your current issue) through build.typescript.typeCheck following options here : https://github.com/Realytics/fork-ts-checker-webpack-plugin#options
like
export default {
rootDir: './src/ui'
build: {
typescript: {
typeCheck: {
tsconfig: './src/ui/tsconfig.json'
}
}
}
}
But be aware you need to create the full tsconfig.json within ./src/ui, Nuxt won't autogenerate or override it, it only handles root one.
Regarding your outpur error which is related to the type checker plugin, I guess this solution should fix your issue.
@kevinmarrec , Thanks for your answer and explanation.
I found simple solution how to isolate nuxt from the other part of the project.
I just moved nuxt.config to src/ui and deleted rootDir option.
It's like a subproject.

Most helpful comment
@kevinmarrec , Thanks for your answer and explanation.
I found simple solution how to isolate nuxt from the other part of the project.

I just moved nuxt.config to src/ui and deleted rootDir option.
It's like a subproject.