从零开始创建vite项目

2023-11-2308:06:35WEB前端开发Comments1,404 views字数 296阅读模式

Vite官方文档:https://cn.vitejs.dev/guide/文章源自菜鸟学院-https://www.cainiaoxueyuan.com/gcs/57360.html

创建项目目录:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/gcs/57360.html

mkdir shop_admin

进入项目目录:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/gcs/57360.html

cd shop_admin

设置npm国内镜像:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/gcs/57360.html

npm config set registry https://registry.npm.taobao.org/

安装打包工具:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/gcs/57360.html

npm install -g yarn

使用yarn+vite创建前端项目:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/gcs/57360.html

yarn create vite fontend --template vue

进入前端项目:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/gcs/57360.html

cd fontend

安装依赖:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/gcs/57360.html

yarn

启动服务:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/gcs/57360.html

yarn dev

浏览器访问:http://localhost:5173/文章源自菜鸟学院-https://www.cainiaoxueyuan.com/gcs/57360.html

  • 本站内容整理自互联网,仅提供信息存储空间服务,以方便学习之用。如对文章、图片、字体等版权有疑问,请在下方留言,管理员看到后,将第一时间进行处理。
  • 转载请务必保留本文链接:https://www.cainiaoxueyuan.com/gcs/57360.html

Comment

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定