Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
create-vite
Advanced tools
The create-vite npm package is a tool for quickly scaffolding a new Vite project. Vite is a build tool that aims to provide a faster and leaner development experience for modern web projects. The create-vite package allows you to set up a new project with a variety of templates and configurations, making it easier to get started with Vite.
Create a new Vite project
This command initializes a new Vite project in a directory named 'my-vite-app'. It sets up the basic structure and configuration files needed to start developing with Vite.
npx create-vite@latest my-vite-app
Choose a template
This command initializes a new Vite project using a specific template, in this case, a React template. Vite supports various templates like vanilla, vue, react, preact, lit, and more.
npx create-vite@latest my-vite-app --template react
Interactive project setup
Running this command without additional arguments will start an interactive prompt where you can choose the project name and template interactively. This is useful for users who prefer a guided setup process.
npx create-vite@latest
Create React App is a tool for setting up a new React project with a single command. It provides a similar experience to create-vite but is specifically tailored for React projects. Unlike Vite, Create React App uses Webpack as its build tool.
Vue CLI is a standard tooling for Vue.js development. It offers a similar project scaffolding experience to create-vite but is specifically designed for Vue.js projects. Vue CLI provides a more extensive set of features and plugins compared to Vite's simpler setup.
Parcel is a web application bundler that offers a zero-configuration setup similar to Vite. It aims to provide a fast and easy development experience but is more general-purpose and not tied to any specific framework like Vite is with its templates.
Compatibility Note: Vite requires Node.js version 18+, 20+. However, some templates require a higher Node.js version to work, please upgrade if your package manager warns about it.
With NPM:
$ npm create vite@latest
With Yarn:
$ yarn create vite
With PNPM:
$ pnpm create vite
With Bun:
$ bun create vite
Then follow the prompts!
You can also directly specify the project name and the template you want to use via additional command line options. For example, to scaffold a Vite + Vue project, run:
# npm 7+, extra double-dash is needed:
npm create vite@latest my-vue-app -- --template vue
# yarn
yarn create vite my-vue-app --template vue
# pnpm
pnpm create vite my-vue-app --template vue
# Bun
bun create vite my-vue-app --template vue
Currently supported template presets include:
vanilla
vanilla-ts
vue
vue-ts
react
react-ts
react-swc
react-swc-ts
preact
preact-ts
lit
lit-ts
svelte
svelte-ts
solid
solid-ts
qwik
qwik-ts
You can use .
for the project name to scaffold in the current directory.
create-vite is a tool to quickly start a project from a basic template for popular frameworks. Check out Awesome Vite for community maintained templates that include other tools or target different frameworks. You can use a tool like degit to scaffold your project with one of the templates.
npx degit user/project my-project
cd my-project
npm install
npm run dev
If the project uses main
as the default branch, suffix the project repo with #main
npx degit user/project#main my-project
FAQs
## Scaffolding Your First Vite Project
The npm package create-vite receives a total of 168,079 weekly downloads. As such, create-vite popularity was classified as popular.
We found that create-vite demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.