feat: add ForkTsChecker

This commit is contained in:
Igor Randjelovic
2020-11-25 12:41:45 +01:00
parent 1894cd46e8
commit 015d337e2a
7 changed files with 116 additions and 2 deletions

View File

@ -2,6 +2,7 @@ import { DefinePlugin, HotModuleReplacementPlugin } from 'webpack';
import Config from 'webpack-chain';
import path from 'path';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
import { CleanWebpackPlugin } from 'clean-webpack-plugin';
import CopyWebpackPlugin from 'copy-webpack-plugin';
@ -134,6 +135,15 @@ export default function (config: Config, env: IWebpackEnv): Config {
},
});
// Use Fork TS Checker to do type checking in a separate non-blocking process
config.plugin('ForkTsCheckerWebpackPlugin').use(ForkTsCheckerWebpackPlugin, [
{
typescript: {
memoryLimit: 4096,
},
},
]);
// set up js
// todo: do we need babel-loader? It's useful to support it
config.module