To create a vite project, one command to create

1. Open a cmd command window in a folder and enter the command:

npm init vue@latest
//注意,此命令安装的是vue最新的依赖包,步骤也许跟以下有点点区别,不过问题不大

2. Then ask if you need to install the following packages, these are all required, enter y and press Enter

3. Then start a project name, the default is vue-project 

 4. Next, choose whether to use TypeScript according to your personal needs. If you don’t know what TypeScript is, choose No

 5. Then JSX is the same, if you don’t know what it is, choose No

6. Then whether to add a route (Router), choose according to your needs, I usually choose yes for this

7. Then whether to add Pinia, Pinia has the same function as vuex, which is used for global shared data, and can be added as needed

 

8. Next, whether to add unit tests, I have not added it, it should be some small demos or the like

9. Next, whether to add an end-to-end solution, I have no contact with it, I choose No

 

 10. Next, whether to add ESLint code verification, for standardizing code, I choose No

         Then it is created:

 11. If you are still in this window , run these three commands one by one:

  cd vue-project
  npm install
  npm run dev

        If you no longer see this window, go to the project directory you just created and open the command line to enter the following two commands:

  npm install
  npm run dev

12. Paste the address of local: into the address bar of the browser and it will be ok. I have to say that vite is really fast as its name suggests.

 

 

Guess you like

Origin blog.csdn.net/qq_68155756/article/details/131916261