当前位置:网站首页>Vite3 learning records
Vite3 learning records
2022-07-23 20:53:00 【TangAcrab】
1、 Installable vue-tsc , By running vue-tsc --noEmit Come on vue File type check
2、vite Use esbuild take ts Convert to js
3、 At present vite3.02 In the version , It is temporarily necessary to tsconfig.json Medium compilerOptions In the options , Set up
"isolatedModules": true and "skipLibCheck": true. because vue For the new version ts The support of is not very good , Do adaptation .
4、vite Also through esbuild Come on tsx Be supported . stay vue Can be used in @vitejs/plugin-vue-jsx Plug in to support writing jsx Code .
5、 Use import To load static resources

6、 Use import.meta.glob To implement global import

7、vite Our goal is modern browsers , add to vite Support for traditional browsers is as follows

8、 Common images 、 Media and font file types are vite Automatically detect as resource , And automatically process when packaging , For example, when developing environment The picture path is /img.png, But it will be handled as /assets/img.hashcode.png. Can be in vite.config.ts Use in assetsInclude Options Expand vite Detection of static resources . for example .gif
9、 You can put some single use static resources into public Under the table of contents , Use similar /icon.png Absolute path to access

10、vite adopt rollup To pack
11、 vite adopt import.meta.env To expose environment variables , Common built-in variables are

12、 In the created custom environment variable , Must be VITE_ start , Can pass import.meta.env.VITE_MY To visit in the form of


13、 By means of src Wear under the catalog env.d.ts file , To add type hints for custom environment variables

14、 You can compile environments in different modes at build time

15、vite Unique plug-ins to vite-plugin- start . When using plug-ins , In addition to the package.json In a statement , Still need to be in vite.config.json I quote , And in plugins Use in

16、 Use environment variables when configuring

边栏推荐
- 最小生成树:Kruskal
- Detailed explanation of MSTP protocol for layer 3 switch configuration [Huawei ENSP experiment]
- 1063 Set Similarity
- [shader realizes roundwave circular ripple effect _shader effect Chapter 6]
- win7-vs2012下安装.net frame work 的过程图文详解
- Interpretation of Flink catalog
- ssm+mysql实现零食商城系统(电商购物)
- Read the five flow indicators of R & D efficiency insight
- OOM机制
- [100 cases of scratch drawing] Figure 46-scratch drawing flowers children's programming scratch programming drawing case tutorial grade examination competition drawing training case
猜你喜欢

做一个有职业操守的软件匠人

【复数 重载运算符】

STM32C8t6 驱动激光雷达实战(二)

Jetson nano recording stepping on the pit (it will definitely solve your problem)

jsp+ssm+mysql实现的租车车辆管理系统汽车租赁

Himawari-8 数据介绍及下载方法

Yiwen teaches you how to install MySQL

【着色器实现RoundWave圆形波纹效果_Shader效果第六篇】

2022.7.11 MySQL job

Unity解决动画不可用:The AnimationClip ‘XXX‘ used by the Animation component ‘XXX‘ must be marked as Legacy.
随机推荐
1063 Set Similarity
ES6特性:Promise(自定义封装)
(Note)优化器Adam的学习率设置
利用ENVI对TROPOMI(哨兵5P)数据预处理
【LeetCode】Day101-旋转图像
Junior intern, ByteDance, after sharing, has been offered
Lingo basic use
OpenIM重大升级-群聊读扩散模型发布 群管理功能升级
一文教你Mysql安装
Preprocessing tropomi (sentinel 5p) data with envi
高数下|三重积分的计算2|高数叔|手写笔记
If the order is not paid within 30 minutes, it will be automatically cancelled
Comment présenter votre expérience de projet lors d'une entrevue
From which dimensions can we judge the quality of code? How to have the ability to write high-quality code?
Cesium knockout怎么用?
Detailed explanation of MSTP protocol for layer 3 switch configuration [Huawei ENSP experiment]
LU_ASR01语音模块使用
[continuous update] collection of raspberry pie startup and failure series
从哪些维度评判代码质量的好坏?如何具备写出高质量代码的能力?
如何在面试中介绍自己的项目经验