简体   繁体   中英

How to create vue project with vite and yarn

I watch Vue series on Udemy. He write yarn add vue@3.0.7 and yarn add vite@2.1.1 --developer. Also I'm writing thoose commands in a terminal but I see node_modules, package.json files src folder is missing. How to create dynamiclly in src folder? I don't want to download and setup empty project.

Vite's Getting Started docs show how to use yarn to scaffold a project, including package.json (which will have the necessary dependencies) and the src directory.

Use the following command to create a directory named my-vite-project , and select vue when prompted:

yarn create vite my-vite-project

Example run:

$ yarn create vite my-vite-project
yarn create v1.16.0
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...

success Installed "create-vite@2.6.4" with binaries:
      - create-vite
      - cva
✔ Select a framework: › vue
✔ Select a variant: › vue

Scaffolding project in /Users/tony/src/tmp/my-vite-project...

Done. Now run:

  cd my-vite-project
  yarn
  yarn dev

✨  Done in 38.38s.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM