mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 20:11:24 +08:00
feat: add ForkTsChecker
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user