Registry / devops / vite-plugin-tsc-watch

vite-plugin-tsc-watch

JSON →
library3.1.2jsnpmunverified

Plugs tsc --watch into Vite dev server, enabling TypeScript type-checking during development without blocking the build pipeline. Current stable version is 3.1.2 (Feb 2025), with releases roughly every 6 months tracking Vite and TypeScript peer updates. Key differentiators: dev-only, low-noise (no overlay), uses Vite's dev server for logging, lightweight compared to alternatives like fork-ts-checker-webpack-plugin. Supports TS solution config and ESM-only since v3.

npm install vite-plugin-tsc-watch
INSTALL
IMPORT
SIG · VITE-PLUGIN-TSC-WA
V
vite-plugin-tsc-watch
devopsjavascriptv3.1.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

tscWatch
import { tscWatch } from 'vite-plugin-tsc-watch'
import tscWatch from 'vite-plugin-tsc-watch'
Named export only since v3.0.0; default export was removed in v2.0.0, renamed in v3.0.1.
vite-plugin-tsc-watch
import { tscWatch } from 'vite-plugin-tsc-watch'
const { tscWatch } = require('vite-plugin-tsc-watch')
Plugin is ESM-only since v3.0.1; require() triggers a warning. Use ESM import or migrate Vite to ESM.

Import the named export `tscWatch` and add it to the Vite plugins array.

import { defineConfig } from 'vite'; import { tscWatch } from 'vite-plugin-tsc-watch'; export default defineConfig({ plugins: [tscWatch()], });
Debug
Known issues
breakingDefault export removed in v2.0.0, replaced with named export `tscPlugin`. In v3.0.1, renamed to `tscWatch`.
fix
Use `import { tscWatch } from 'vite-plugin-tsc-watch'` instead of default import.
affects: >=2.0.0 <3.0.1
breakingESM-only since v3.0.1; CommonJS require() is deprecated but still works with a warning.
fix
Switch to ESM imports or migrate Vite to ESM (see Vite migration guide).
affects: >=3.0.1
breakingDropped support for Vite 2 & 3 and Node <18 in v3.0.1.
fix
Upgrade to Vite 4+ and Node 18+.
affects: >=3.0.1
deprecatedThe named export `tscPlugin` (v2.0.0 to v3.0.0) is deprecated; use `tscWatch` instead.
fix
Rename `tscPlugin` to `tscWatch` in your imports.
affects: >=2.0.0 <3.0.1
gotchaThe plugin does not emit compiled JS files; you must set `noEmit: true` in tsconfig to avoid file pollution.
fix
Add `"noEmit": true` to `compilerOptions` in your tsconfig.json.
affects: *
Errors
Common errors & fixes
Error: The plugin 'vite-plugin-tsc-watch' requires a named export 'tscWatch'
Using default import after v3.0.1 when plugin switched to ESM and named export.
fix
Replace `import tscWatch from ...` with `import { tscWatch } from 'vite-plugin-tsc-watch'`.
TypeError: vitePluginTscWatch is not a function
Using `const tscWatch = require('vite-plugin-tsc-watch')` in CJS context after v3.0.1 (ESM-only).
fix
Switch to ESM import or use dynamic import: `const { tscWatch } = await import('vite-plugin-tsc-watch')`.
Error: Cannot find module 'vite-plugin-tsc-watch' or its corresponding type declarations.
Missing or incompatible peer dependencies (typescript or vite).
fix
Run `npm install -D typescript vite` to install peer dependencies.
Upgrade
Version history
3.1.2latest on npm
Audit
Dependencies
typescriptrequiredPeer dependency for running tsc
viterequiredPeer dependency for Vite plugin API
Agent activity
4 hits · last 30 days
node
4
Resources
vite-plugin-tsc-watch — npm install vite-plugin-tsc-watch · libregistry