diff --git a/packages/vite/src/generators/init/init.ts b/packages/vite/src/generators/init/init.ts index ee3f2ee709f1c..6a5018ec96364 100644 --- a/packages/vite/src/generators/init/init.ts +++ b/packages/vite/src/generators/init/init.ts @@ -7,10 +7,10 @@ import { Tree, updateNxJson, } from '@nx/devkit'; -import { addPluginV1 } from '@nx/devkit/src/utils/add-plugin'; +import { addPlugin } from '@nx/devkit/src/utils/add-plugin'; import { setupPathsPlugin } from '../setup-paths-plugin/setup-paths-plugin'; -import { createNodes } from '../../plugins/plugin'; +import { createNodesV2 } from '../../plugins/plugin'; import { InitGeneratorSchema } from './schema'; import { checkDependenciesInstalled, moveToDevDependencies } from './lib/utils'; @@ -61,11 +61,11 @@ export async function initGeneratorInternal( schema.addPlugin ??= addPluginDefault; if (schema.addPlugin) { - await addPluginV1( + await addPlugin( tree, await createProjectGraphAsync(), '@nx/vite/plugin', - createNodes, + createNodesV2, { buildTargetName: ['build', 'vite:build', 'vite-build'], testTargetName: ['test', 'vite:test', 'vite-test'],