Vite is a next-generation frontend build tool, currently at stable version 8.0.8, designed to significantly improve the frontend development experience. It functions as a dev server serving source files over native ES modules with fast Hot Module Replacement (HMR), and a build command that bundles code with Rollup for optimized production assets. Vite provides rich built-in features, a universal plugin interface, and fully typed APIs, making it highly extensible. Patch releases are frequent, with major versions released periodically.
npm install viteVerified import paths — ran on the pinned version, not inferred.
This command creates a new Vite project using the `create-vite` scaffold, setting up a React project with TypeScript. It then navigates into the project directory, installs dependencies, and starts the development server.
Upgrade your Node.js installation to version 20.19.0 or higher, or 22.12.0 or higher.
Ensure your configuration file uses `export default` for its primary export and ESM `import` statements. If using a `.js` file, ensure your project's `package.json` has `"type": "module"` or rename the config file to `vite.config.mjs`.
Rename your environment variables (e.g., `.env` file) to `VITE_MY_VAR` and access them via `import.meta.env.VITE_MY_VAR`.
Ensure `esbuild` is installed in your project: `npm install esbuild` or `yarn add esbuild` or `pnpm add esbuild`.
Install the plugin (`npm install -D @vitejs/plugin-legacy`) and add it to your `vite.config.js` plugins array.
Ensure your `vite.config.js` file is interpreted as an ES Module. This can be done by adding `"type": "module"` to your `package.json` or by renaming `vite.config.js` to `vite.config.mjs`.
Upgrade your Node.js installation to version `^20.19.0` or `>=22.12.0`.
Use `import.meta.env` for environment variables in client-side code. For custom variables, ensure they are prefixed with `VITE_` (e.g., `VITE_APP_API_URL`).
Verify that `some-package` is installed correctly via `npm install some-package`. Check the module's documentation for correct import paths and ensure its `package.json` properly defines its exports for ESM environments.
Check the module's documentation or source code for available exports. Ensure named exports are correctly defined or consider using a default import if the module primarily uses default exports.
No dependency data recorded yet.