From 7436ab792cd663f20d001e9820568842cbacf9fe Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Wed, 19 Apr 2023 10:01:12 -0400 Subject: [PATCH] feat(react): add @nx/web as a dependency since it is needed by cypress/jest/etc. --- packages/react/package.json | 3 ++- packages/react/src/generators/application/lib/add-cypress.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/react/package.json b/packages/react/package.json index d8a0568ca77de..c904471494c36 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -38,7 +38,8 @@ "minimatch": "3.0.5", "@nx/devkit": "file:../devkit", "@nx/js": "file:../js", - "@nx/linter": "file:../linter" + "@nx/linter": "file:../linter", + "@nx/web": "file:../web" }, "publishConfig": { "access": "public" diff --git a/packages/react/src/generators/application/lib/add-cypress.ts b/packages/react/src/generators/application/lib/add-cypress.ts index ac5cfc1052cbf..2886adb0e480b 100644 --- a/packages/react/src/generators/application/lib/add-cypress.ts +++ b/packages/react/src/generators/application/lib/add-cypress.ts @@ -1,4 +1,5 @@ -import { ensurePackage, joinPathFragments, Tree } from '@nx/devkit'; +import { ensurePackage, Tree } from '@nx/devkit'; +import { webStaticServeGenerator } from '@nx/web'; import { nxVersion } from '../../../utils/versions'; import { NormalizedSchema } from '../schema'; @@ -7,7 +8,6 @@ export async function addCypress(host: Tree, options: NormalizedSchema) { return () => {}; } - const { webStaticServeGenerator } = ensurePackage('@nx/web', nxVersion); await webStaticServeGenerator(host, { buildTarget: `${options.projectName}:build`, targetName: 'serve-static',