nuxt-tsconfig-stub
Stub Nuxt's generated tsconfig.json at installation.
Motivation
Nuxt handles the tsconfig under.nuxt/tsconfig.json
dynamically for you. And commonly your root tsconfig.json is essential a redirection like:{
"extends": "./.nuxt/tsconfig.json"
}
The directory
.nuxt
is excluded from the source control. Meaning in CI environment, the .nuxt/tsconfig.json
does not exist on the initial check out, which might causing some TypeScript related tools fail. You can run nuxi prepare
asking Nuxt to generate one for you, or any Nuxt commands like nuxi dev
nuxi build
will also generate the file for you.This package is to solve a niche problem that you might want to use the tsconfig before running Nuxt commands. This uses
postinstall
to create an empty JSON file at .nuxt/tsconfig.json
if it does not exist already.Install
npm i nuxt-tsconfig-stub -D
That's it.
Sponsors
<img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'/>