nx/packages/react/src/utils/has-vite-plugin.ts

11 lines
270 B
TypeScript

import { readNxJson, Tree } from '@nx/devkit';
export function hasVitePlugin(tree: Tree) {
const nxJson = readNxJson(tree);
return !!nxJson.plugins?.some((p) =>
typeof p === 'string'
? p === '@nx/vite/plugin'
: p.plugin === '@nx/vite/plugin'
);
}