惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Apple Machine Learning Research
Apple Machine Learning Research
L
LangChain Blog
GbyAI
GbyAI
博客园_首页
V
Visual Studio Blog
Martin Fowler
Martin Fowler
WordPress大学
WordPress大学
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 叶小钗
腾讯CDC
博客园 - Franky
IT之家
IT之家
Google DeepMind News
Google DeepMind News
Microsoft Azure Blog
Microsoft Azure Blog
D
Docker
大猫的无限游戏
大猫的无限游戏
Recent Announcements
Recent Announcements
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
B
Blog
酷 壳 – CoolShell
酷 壳 – CoolShell

博客园 - Ratooner

.NET7 IOC注册SqlSugar .NET 7.0 Program.cs访问appsettings.json配置文件 vite学习笔记 vue3 el-image图片资源的使用 bootstrap.bundle.min.js bootstrap.bundle.min.js.map 404报错 js中===和==的区别 json-server 笔记 openstack heat 实验笔记 openstack neutron 实验笔记 openstack nova 实验笔记 openstack glance 实验笔记 openstack keystone 实验笔记 Vue 中npm run dev 和 npm run serve 的区别 Flask+Vue 使用 vue 学习笔记1 vue export学习笔记1 GRE和VXLAN的区别 openstack各组件逻辑关系图(转载) openstack创建云主机流程图(转载)
vue3创建项目笔记
Ratooner · 2023-04-06 · via 博客园 - Ratooner

******使用vite方式创建应用

E:\vue3学习>npm init vite@latest vite-blog -- --template vue
Need to install the following packages:
create-vite@4.2.0
Ok to proceed? (y) y

Scaffolding project in E:\vue3学习\vite-blog...

Done. Now run:

cd vite-blog
npm install
npm run dev

npm notice
npm notice New minor version of npm available! 9.5.0 -> 9.6.4
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.6.4
npm notice Run npm install -g npm@9.6.4 to update!
npm notice

E:\vue3学习>cd vite-blog

E:\vue3学习\vite-blog>npm install
npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead

added 32 packages, and audited 33 packages in 45s

5 packages are looking for funding
run `npm fund` for details

found 0 vulnerabilities

E:\vue3学习\vite-blog>

创建完成后可以将vite-blog拖拽至vs code进行编辑。

**************使用脚手架创建应用

npm i -g @vue/cli  //安装@vue/cli 脚手架

vue create test  //创建test app

***************vite创建应用

npm install -g create-vite-app  //安装vite

create-vite-appreat vue3-vite //创建vite应用

cd vue3-vite 

npm install

npm run dev

pnpm方式

pnpm create vite 

******************安装typescript 支持

npm  add typescript -D  //安装typescript

PS E:\newsvn\vue3学习\vue3-vite> npx tsc --init  //在vscode终端运行

 shim.d.ts 文件内容

declare module "*.vue" {

    import { Component } from "vue";

    const component:Component

    export default component;

}

**********安装支持sass

PS E:\newsvn\vue3学习\vue3-vite> npm add sass sass-loader -D

安装后检查package.json文件

  "devDependencies": {

    "@vue/compiler-sfc": "^3.0.4",

    "sass": "^1.62.0",  //安装后的提示

    "sass-loader": "^13.2.2", //安装后的提示

    "typescript": "^5.0.4",

    "vite": "^1.0.0-rc.13"

  }