DEV Community

Discussion on: πŸ“¦ webpack secrets

Collapse
 
nickytonline profile image
Nick Taylor

For those using TypeScript, the Fork TS Checker Webpack plugin is a must for any somewhat large project.

It allows you to run the TypeScript type checker in a separate process which results in faster builds.

GitHub logo TypeStrong / fork-ts-checker-webpack-plugin

Webpack plugin that runs typescript type checker on a separate process.

Fork TS Checker Webpack Plugin

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

npm version build status downloads commitizen friendly code style: prettier semantic-release

Features

Installation

This plugin requires minimum Node.js 10, Webpack 4, TypeScript 2.7 and optionally ESLint 6

  • If you depend on Webpack 2, Webpack 3, or TSLint 4, please use version 3 of the plugin.
  • If you depend on TypeScript >= 2.1 and < 2.7 or you can't update to Node 10, please use version 4 of the plugin.
# with npm
npm install --save-dev fork-ts-checker-webpack-plugin
# with yarn
yarn add --dev fork-ts-checker-webpack-plugin
Enter fullscreen mode Exit fullscreen mode

The minimal webpack config (with ts-loader)

// webpack.config.js
const ForkTsCheckerWebpackPlugin = require
…
Enter fullscreen mode Exit fullscreen mode

Where I used to work, we had a very large project and it brought down the initial webpack build time from 2 minutes to 25-30 seconds.

And it looks like they also have an alpha out for webpack 5.

Liquid error: internal