From bf62661bb987e1746da04506d32a4d28726cb4ed Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Mon, 5 Feb 2024 18:04:39 -0500 Subject: [PATCH] fix(webpack): require ForkTsCheckerWebpackPlugin only as required (#21629) --- .../src/plugins/nx-webpack-plugin/lib/apply-base-config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.ts b/packages/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.ts index 9d02cc12a8fa2..3ab32b13511a3 100644 --- a/packages/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.ts +++ b/packages/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.ts @@ -19,7 +19,6 @@ import { createLoaderFromCompiler } from './compiler-loaders'; import { NormalizedNxWebpackPluginOptions } from '../nx-webpack-plugin-options'; import TerserPlugin = require('terser-webpack-plugin'); import nodeExternals = require('webpack-node-externals'); -import ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const IGNORED_WEBPACK_WARNINGS = [ /The comment file/i, @@ -223,6 +222,7 @@ function applyNxDependentConfig( }; if (!options?.skipTypeChecking) { + const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); plugins.push( new ForkTsCheckerWebpackPlugin({ typescript: {