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.

npm install fork-ts-checker-webpack-plugin
INSTALL
IMPORT
SIG · FORK-TS-CHECKER-WE
F
fork-ts-checker-webpack-plugin
devopsjavascriptv9.1.0
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

ForkTsCheckerWebpackPlugin
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import { ForkTsCheckerWebpackPlugin } from 'fork-ts-checker-webpack-plugin';
The plugin is a default export. While Webpack configurations often use CommonJS `require()`, modern JavaScript modules use the default import syntax.
ForkTsCheckerWebpackPlugin (CommonJS)
const ForkTsCheckerWebpackPlugin = require('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.
ForkTsCheckerWebpackPlugin.Options
import type { ForkTsCheckerWebpackPluginOptions } from 'fork-ts-checker-webpack-plugin';
Import the type definition for plugin options for type-safe configuration in TypeScript.

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 issues
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.
fix
Upgrade your Node.js environment to version 14.21.3 or higher. If unable to upgrade Node.js, downgrade the plugin to version 8.x.
affects: >=9.0.0
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.
fix
For Vue.js support, downgrade to `fork-ts-checker-webpack-plugin@6` or implement a custom type checking solution for Vue SFCs.
affects: >=8.0.0
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.
fix
Add `options: { transpileOnly: true }` to your `ts-loader` rule in `webpack.config.js`.
affects: <9.3.0 (ts-loader)
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.
fix
Adjust the `watchOptions.ignored` pattern to specifically include only external `node_modules` or remove it if using a monorepo setup with symlinked packages.
affects: >=1.0.0
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.
fix
Ensure your `fork-ts-checker-webpack-plugin` version aligns with your Webpack and TypeScript versions. For Webpack 4, use plugin version 6.x. For TypeScript 2.1-2.6.2, use plugin version 4.x. For TypeScript 2.7-3.5.3, use plugin version 6.x.
affects: <8.0.0
Errors
Common errors & fixes
Error: Worker caught an error: Unhandled error in worker.
The plugin's worker process crashed due to an unhandled internal error, often related to an unexpected TypeScript or system state.
fix
This specific error was fixed in `v9.0.1`. Upgrade `fork-ts-checker-webpack-plugin` to version 9.0.1 or newer. If the problem persists, check your TypeScript configuration for any unusual setups or corrupted files.
Type checking occurs in node_modules on Windows, leading to unexpected errors or slow performance.
An issue in older versions of the plugin on Windows where `node_modules` directories were not correctly ignored by the type checker.
fix
Upgrade `fork-ts-checker-webpack-plugin` to version 8.0.0 or newer. This version includes a fix for ignoring `node_modules` on Windows.
Error: 'performance.now()' is not compatible with TypeScript 5.
Compatibility issues with the plugin's performance API when used with TypeScript 5.
fix
Upgrade `fork-ts-checker-webpack-plugin` to version 6.5.3 or newer. This version provides compatibility with TypeScript 5's performance API.
No TypeScript errors are displayed in Webpack output, even though `tsc` reports errors.
The plugin might not be correctly configured, or `ts-loader` is running in `transpileOnly: false` mode, causing it to block compilation on errors before the plugin can report them.
fix
Ensure `fork-ts-checker-webpack-plugin` is correctly instantiated in your Webpack plugins array. Verify `ts-loader` has `options: { transpileOnly: true }` enabled to delegate type checking to the plugin.
Upgrade
Version history
9.1.0latest on npm
Audit
Dependencies
typescriptrequiredRequired for type checking.
webpackrequiredCore dependency as a Webpack plugin.
Agent activity
3 hits · last 30 days
node
2
Resources