From 6b73a474b268192ca477ffd7b9a3b35a53b9aba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leosvel=20P=C3=A9rez=20Espinosa?= Date: Mon, 29 May 2023 08:45:39 +0100 Subject: [PATCH] fix(nest): require typescript lazily in library generator --- .../nest/src/generators/library/lib/add-exports-to-barrel.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/nest/src/generators/library/lib/add-exports-to-barrel.ts b/packages/nest/src/generators/library/lib/add-exports-to-barrel.ts index b1ff4514074792..1e1809cfc0c498 100644 --- a/packages/nest/src/generators/library/lib/add-exports-to-barrel.ts +++ b/packages/nest/src/generators/library/lib/add-exports-to-barrel.ts @@ -1,7 +1,6 @@ import type { Tree } from '@nx/devkit'; import { addGlobal, removeChange } from '@nx/js'; import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; -import * as ts from 'typescript'; import type { NormalizedOptions } from '../schema'; let tsModule: typeof import('typescript'); @@ -24,7 +23,7 @@ export function addExportsToBarrelFile( // find the export in the source file const exportStatement = sourceFile.statements.find((statement) => - ts.isExportDeclaration(statement) + tsModule.isExportDeclaration(statement) ); sourceFile = removeChange(