From 1f057e8c0a6c0c61b60bbb4f120cbca8a4930130 Mon Sep 17 00:00:00 2001 From: Darius Date: Tue, 10 Sep 2024 16:09:13 +0300 Subject: [PATCH] fix: generate serve-static only if e2eTestRunner is passed Newly created app should not generate serve-static target under project.json if e2eTestRunner flag is not passed --- packages/angular/src/generators/application/lib/add-e2e.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/angular/src/generators/application/lib/add-e2e.ts b/packages/angular/src/generators/application/lib/add-e2e.ts index 717ea779862be..4deb99d86e755 100644 --- a/packages/angular/src/generators/application/lib/add-e2e.ts +++ b/packages/angular/src/generators/application/lib/add-e2e.ts @@ -27,8 +27,11 @@ export async function addE2e(tree: Tree, options: NormalizedSchema) { options.name, options.port ); - // TODO: This can call `@nx/web:static-config` generator when ready - addFileServerTarget(tree, options, 'serve-static', e2eWebServerInfo.e2ePort); + + if (options.e2eTestRunner) { + // TODO: This can call `@nx/web:static-config` generator when ready + addFileServerTarget(tree, options, 'serve-static', e2eWebServerInfo.e2ePort); + } if (options.e2eTestRunner === 'cypress') { const { configurationGenerator } = ensurePackage<