Registry / devops / fork-ts-checker-webpack-plugin

fork-ts-checker-webpack-plugin

JSON →
library9.1.0jsnpmunverified

The `fork-ts-checker-webpack-plugin` is a Webpack plugin designed to significantly improve build performance in TypeScript projects by offloading the TypeScript type checking process to a separate worker process. This allows `ts-loader` or `babel-loader` to operate in `transpileOnly` mode, focusing solely on transpilation without blocking the main Webpack compilation thread for type checks. The current stable version is 9.1.0, released on April 3, 2025. The project has a moderately active release cadence, issuing several patches and minor versions annually, with major versions arriving less frequently but introducing breaking changes like Node.js or TypeScript version bumps. Key differentiators include its support for modern TypeScript features such as project references and incremental builds, and its ability to display well-formatted error messages with code frames directly within the Webpack output. It's an essential tool for maintaining fast build times in large TypeScript-based Webpack applications.

devops
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

The plugin is a default export. While Webpack configurations often use CommonJS `require()`, modern JavaScript modules use the default import syntax.

import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';

This is the most common way to import the plugin in `webpack.config.js` files, which are typically CommonJS modules.

const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');

Import the type definition for plugin options for type-safe configuration in TypeScript.

import type { ForkTsCheckerWebpackPluginOptions } from 'fork-ts-checker-webpack-plugin';

This quickstart demonstrates how to integrate `fork-ts-checker-webpack-plugin` with `ts-loader` in a minimal Webpack configuration. It highlights the use of `transpileOnly: true` on `ts-loader` to offload type checking to the plugin's separate process, thereby speeding up build times.

const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); module.exports = { context: __dirname, entry: './src/index.ts', resolve: { extensions: [".ts", ".tsx", ".js"] }, module: { rules: [ { test: /\.tsx?$/, loader: 'ts-loader', options: { transpileOnly: true // Crucial for performance with this plugin } } ] }, plugins: [new ForkTsCheckerWebpackPlugin()], watchOptions: { ignored: /node_modules/ // Adjust for monorepos } };
Debug
Known footguns
breakingVersion 9.0.0 of `fork-ts-checker-webpack-plugin` dropped support for Node.js v12. Users must upgrade to Node.js v14.21.3 or newer.
breakingVersion 8.0.0 removed built-in support for Vue.js SFCs (Single File Components). Projects relying on Vue.js type checking should use version 6.x of the plugin or integrate alternative solutions.
gotchaIf using `ts-loader` versions older than 9.3.0, it is essential to set `transpileOnly: true` in its options. Failure to do so will cause `ts-loader` to perform type checking itself, negating the performance benefits of this plugin.
gotchaThe `watchOptions.ignored: /node_modules/` configuration in Webpack can cause issues in monorepos or projects with linked packages, as changes in `node_modules` of linked packages might not trigger recompilations.
breakingOlder versions of Webpack (v4) or TypeScript (2.1-2.6.2 or 2.7-3.5.3) require specific older versions of `fork-ts-checker-webpack-plugin`. Consult the README for compatibility matrices.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
11 hits · last 30 days
gptbot
4
ahrefsbot
4
script
1
bingbot
1
googlebot
1
Resources