vite-plugin-tsc
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

vite-plugin-tsc

A Vite plugin which spawns a tsc --watch process with Vite dev server.

npm install -D vite-plugin-tsc

How to use

// vite.config.js
import tscPlugin from "vite-plugin-tsc"

/** @type {import("vite").UserConfig} */
const config = {
  plugins: [tscPlugin()],

  // Not required, but recommended.
  logLevel: "silent",
}

export default config

And you will get like:

$ npx vite

[13:32:56] File change detected. Starting incremental compilation...

src/index.tsx:21:7 - error TS2322: Type 'boolean' is not assignable to type 'string'.

21 const message: string = false
         ~~~~~~~

[13:32:56] Found 1 error. Watching for file changes.

Why it is a Vite only plugin?

It uses a configResolved hook.

Package Sidebar

Install

npm i vite-plugin-tsc

Weekly Downloads

33

Version

0.1.1

License

GPL-3.0-or-later

Unpacked Size

4.56 kB

Total Files

4

Last publish

Collaborators

  • kazuma1989