Check if a project is using vite
npm:
npm install has-vite
yarn
yarn add has-vite
pnpm
pnpm add has-vite
.
├── foo
│ └── package.json
└── bar
├── package.json
└── vite.config.ts
import { hasVite } from 'has-vite'
hasVite('foo') // => false
hasVite('bar') // => true
Returns a boolean
of whether the project is using vite.
Returns true
if one of bellow functions return true
:
hasViteConfig
hasViteInPkg
Returns a boolean
of whether the project has vite.config.{js,cjs,mjs,ts,cts,mts}
.
Returns a boolean
of whether the project has vite
in dependencies
.
Returns a boolean
of whether the project has vite
in devDependencies
.
Returns a boolean
of whether the project has vite
in peerDependencies
.
Returns a boolean
of whether the project has vite
in dependencies | devDependencies | peerDependencies
.
Returns an object
of a project's package.json
content, returns {}
when package.json
not exist in cwd
.
Current working directory.
Type: string
Default: process.cwd()