Registry / devops / vite-plugin-tsc

vite-plugin-tsc

JSON →
library0.1.1jsnpmunverified

A Vite plugin that spawns an external `tsc --watch` process alongside the Vite dev server, providing TypeScript type checking without interfering with Vite's own transpilation. Current version 0.1.1. Release cadence is low (sporadic). Key differentiator: unlike fork-ts-checker-webpack-plugin for webpack or vite-plugin-checker, this plugin strictly uses `tsc --watch` and deliberately avoids any bundler integration, giving a pure TypeScript checker experience. It utilizes the `configResolved` hook and is not compatible with other bundlers.

npm install vite-plugin-tsc
INSTALL
IMPORT
SIG · VITE-PLUGIN-TSC
V
vite-plugin-tsc
devopsjavascriptv0.1.1
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.

tscPlugin
import tscPlugin from 'vite-plugin-tsc'
import { tscPlugin } from 'vite-plugin-tsc'
The package exports a default function. Named import will not work.
default import (tscPlugin)
const tscPlugin = require('vite-plugin-tsc')
const { tscPlugin } = require('vite-plugin-tsc')
In CommonJS, you must use the default export via require(). The named export does not exist.
Plugin type (TypeScript)
import type { Plugin } from 'vite'
import type { TscPlugin } from 'vite-plugin-tsc'
The package does not export any TypeScript types. Use Vite's Plugin type for strict typing.

Shows minimal configuration to enable tsc --watch in Vite dev server, suppressing Vite's default logs.

// vite.config.js import tscPlugin from 'vite-plugin-tsc' export default { plugins: [ tscPlugin() ], logLevel: 'silent' }
Debug
Known issues
gotchaThe plugin does not pass configuration options to `tsc`. It always runs `tsc --watch` with default settings.
fix
Configure `tsc` via `tsconfig.json` or command-line flags passed to the plugin if supported (currently not).
affects: >=0.0.0
gotchaSetting `logLevel: 'silent'` suppresses Vite's own logs but not `tsc` output. Some Vite logs may still appear.
fix
Use `logLevel: 'silent'` as recommended, but be aware it silences Vite logs, not tsc output.
affects: >=0.0.0
gotchaThe plugin is Vite-only and will not work with other build tools (e.g., webpack, Rollup standalone).
fix
Ensure you are using Vite as the build tool. For other tools, consider fork-ts-checker-webpack-plugin or other alternatives.
affects: >=0.0.0
breakingThe plugin currently has no options object; calling `tscPlugin(options)` will silently ignore options.
fix
No options are supported. Future versions may accept an options object.
affects: 0.1.1
Errors
Common errors & fixes
Error: Cannot find module 'vite-plugin-tsc'
The package is not installed.
fix
Run `npm install -D vite-plugin-tsc` in your project directory.
TypeError: tscPlugin is not a function
Using named import instead of default import.
fix
Use `import tscPlugin from 'vite-plugin-tsc'` (default import) instead of `import { tscPlugin } from 'vite-plugin-tsc'`.
TypeError: (0 , vitePluginTsc_1.default) is not a function
CommonJS require() with destructuring or wrong call.
fix
Use `const tscPlugin = require('vite-plugin-tsc')` and then call `tscPlugin()`.
Cannot find name 'tscPlugin'
TypeScript config not recognizing the import; likely missing type declaration.
fix
Install `@types/node` if needed, or add `vite-plugin-tsc` to `types` in tsconfig.json.
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies
typescriptrequiredRequired as a peer dependency to run `tsc --watch`.
viterequiredRequired as a peer dependency because the plugin is Vite-specific.
Agent activity
6 hits · last 30 days
node
6
Resources
vite-plugin-tsc — npm install vite-plugin-tsc · libregistry