https://codesandbox.io/s/0qmykr7wq0
Using the official Nuxt with TypeScript example on CodeSandbox:
tsconfig.json in any wayTS support will be detected again and any modifications to tsconfig.json will be overridden.
The existing tsconfig.json is unmodified.
The tsconfig.json content is overridden.
I've also noticed that the generation of the tsconfig.json doesn't seem to respect the srcDir setting in the Nuxt config.
For some background: we have a setup where we use TS for our server-side code and our Nuxt code in the same repo. At present, we have a tsconfig.json in the root for our server code and then a separate tsconfig.json for our Nuxt setup in a subdirectory (which is ignored by the first config file).
Since 2.5.0 our root tsconfig.json is being overridden by the automatically generated one. I don't think this would cause any issues if it respected the srcDir config option (i.e. generated it in the subdirectory) although it seems feasible to me that people may want to modify their config and overriding it every time may not be the best option.
Hi @sambowler, we're gonna switch back to the old behavior which was extending a tsconfig.json.
Overriding tsconfig.json is indeed not the best idea (FYI it doesn't exactly override but add missing values in it).
The main issue we have is that we need to take root tsconfig.json for runTime support (nuxt.config.ts / serverMiddlewares), and tsconfig.json from srcDir for webpack related TS files (vue components, plugins).
Thanks for your feedback, it will be closely taken into account. I will refer this issue when I'll open the PR which brings better TS integration.
@kevinmarrec
Since latest it doesn't like "extends": "@nuxt/typescript-edge", line in tsconfig.json. What is the right value for that?
Thanks in advance
@husayt, just removing it should work
Most helpful comment
Hi @sambowler, we're gonna switch back to the old behavior which was extending a
tsconfig.json.Overriding tsconfig.json is indeed not the best idea (FYI it doesn't exactly override but add missing values in it).
The main issue we have is that we need to take root
tsconfig.jsonfor runTime support (nuxt.config.ts / serverMiddlewares), andtsconfig.jsonfromsrcDirfor webpack related TS files (vue components, plugins).Thanks for your feedback, it will be closely taken into account. I will refer this issue when I'll open the PR which brings better TS integration.