fix(vite): add typecheck to vite plugins (#5464)

This commit is contained in:
Daniel Roe 2022-06-15 16:18:45 +01:00 committed by GitHub
parent 11aa8bf739
commit cf255259ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,7 +88,7 @@ export async function buildServer (ctx: ViteBuildContext) {
// Add type-checking
if (ctx.nuxt.options.typescript.typeCheck === true || (ctx.nuxt.options.typescript.typeCheck === 'build' && !ctx.nuxt.options.dev)) {
const checker = await import('vite-plugin-checker').then(r => r.default)
ctx.config.plugins.push(checker({ typescript: true }))
serverConfig.plugins.push(checker({ typescript: true }))
}
await ctx.nuxt.callHook('vite:extendConfig', serverConfig, { isClient: false, isServer: true })