Compared with Webpack, Vite has the following characteristics
1. Fast cold start, no need to wait for packaging
2. Instant hot module update, real on-demand compilation, no need to wait for the entire project to be compiled
Vite build Vue project
Prerequisite: Install Node.js and Vite
The first step <br>Create a Vite project via npm
npm init vite-app 项目名称
# 例如
npm init vite-app HelloVue
The second step <br>When the project is created successfully, cd to the project directory
cd 项目名称
# 例如
cd HelloVue
The third step <br>Install project dependencies
npm install
Step 4 <br>Run the project
npm run dev
Some problems that may occur during the build process
>> npm install 命令很慢或者卡住不动,那是因为npm服务器在境外,必然是很慢的,这边提供两种方案去解决。
【方法一】
https://blog.csdn.net/qq_39595769/article/details/123055196
【方法二】
使用国内镜像(推荐)
(1) 先安装cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
(2) 然后使用cnpm命令
cnpm install
2、npm run dev提示“vite不是内部或外部命令”,可能你还没安装vite,可以输入以下命令进行安装。
npm install vite
After the installation is successful, npm run dev again should be fine.
Author: TANKING
WeChat: sansure2016
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。