@wroud/vite-plugin-tsc
is a Vite plugin designed to transpile TypeScript and its project references using the TypeScript compiler (tsc
). This plugin allows Vite to seamlessly bundle the transpiled code while also providing background type checking for your project, ensuring type safety and enhancing the development workflow.
-
Transpilation: Automatically transpiles TypeScript code using
tsc
. - Background Type Checking: Performs type checking in the background without blocking Vite, allowing for a smoother development experience.
- Watch Mode: Supports watch mode for continuous development.
- Easy Integration: Simple to add to your Vite project.
Install via npm:
npm install @wroud/vite-plugin-tsc
Install via yarn:
yarn add @wroud/vite-plugin-tsc
For detailed usage and API reference, visit the documentation site.
import { defineConfig } from "vite";
import { tscPlugin } from "@wroud/vite-plugin-tsc";
export default defineConfig({
plugins: [
tscPlugin({
tscArgs: ["-b"],
// Enable prebuild to ensure dependencies are built before Vite starts bundling
prebuild: true, // Recommended for projects with TypeScript project references
}),
],
});
import { defineConfig } from "vite";
import { tscPlugin } from "@wroud/vite-plugin-tsc";
export default defineConfig({
plugins: [
tscPlugin({
tscArgs: ["--project", "tsconfig.json"],
// Prebuild is not needed for type checking only
prebuild: false, // Skip prebuilding for faster startup
enableOverlay: true, // Show errors in Vite overlay
}),
],
});
All notable changes to this project will be documented in the CHANGELOG file.
This project is licensed under the MIT License. See the LICENSE file for details.