This package has been deprecated

Author message:

This package is renamed to vite-plugin-checker. See https://github.com/fi3ework/vite-plugin-checker

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

0.1.5 • Public • Published

vite-plugin-ts-checker

Vite plugin that runs TypeScript type checker on a separate process.

Features

  • ⚡️ Out of the box
  • 💚 Support Vue3 with vue-tsc (build mode only for now)
  • 🚥 Vite HMR overlay
  • 🎳 Serve & build mode (TypeScript)

screenshot

Usage

Install

Install plugin

npm i vite-plugin-ts-checker -D

# yarn add vite-plugin-ts-checker -D
# pnpm i vite-plugin-ts-checker -D

Install peer dependencies

vite-plugin-ts-checker requires

to be installed as peer dependency.

Add to vite.config.js

// vite.config.js
import TsChecker from 'vite-plugin-ts-checker'

export default {
  plugins: [TsChecker()],

  // or use options
  // plugins: [TsChecker({ ...options })], // see options
}

Options

export interface PluginOptions {
  /**
   * Use `"tsc"` or `"vue-tsc"`
   * @defaultValue `"tcs"`
   */
  checker: 'tsc' | 'vue-tsc'
  /**
   * Throw in build mode if has error
   * @defaultValue `true`
   */
  enableBuild: boolean
  /**
   * Show overlay when has TypeScript error
   * @defaultValue
   * Same as [Vite config](https://vitejs.dev/config/#root)
   */
  overlay: boolean
  /**
   * Root path to find tsconfig file
   * @defaultValue
   * Same as Vite https://vitejs.dev/config/#root
   */
  root: string
  /**
   * Relative tsconfig path to {@link (PluginOptions:interface).root}
   * @defaultValue `"tsconfig.json"`
   */
  tsconfigPath: string
}

Examples

Run projects in examples/* to try it out.

pnpm i
cd ./examples/<ONE_EXAMPLE>
npm run dev

Roadmap

  • [ ] Support Vue2 by VLS (draft PR)
  • [ ] Support project reference
  • [ ] Wait for vue-tsc to support watch mode

License

MIT

Package Sidebar

Install

npm i vite-plugin-ts-checker

Weekly Downloads

45

Version

0.1.5

License

MIT

Unpacked Size

20.6 kB

Total Files

16

Last publish

Collaborators

  • fi3ework