Vite3 has released 3.0, are you still scrolling? The following article will take a look at the new features of Vite 3.0. The front-end is developing so fast now. Only by maintaining sensitivity to new technologies at all times can we ensure that we will not be eliminated.
Some time ago, Youda released Vite3.0 and updated the official documentation of Vite, as shown below

Enter the homepage anyway. My feeling is just amazing.
This document will briefly introduce the new things in Vite3.0, so don’t get confused.
Changes in templates
As for myself, the Vue project I created most with Vite is the Vue project created with Vite after this update.Vue created using Vite The theme of the template is consistent with Vite's documentation. It also supports dark and light modes, and the icon has been changed from Vue's logo to Vite's logo.
We can use Vite to create a Vue template and run it to see the effect:pnpm create vite # project name -> demo # select a framework -> vue # select a variant -> vue cd demo pnpm install pnpm devThe two themes are as follows

Optimization of Vite CLI
The style of Vite CLI in the command line has also been optimized, see the picture belowdefault port number has also changed, from 3000 to 5173; the Local address has changed from localhost 127.0.0.1.
Changes in import.meta.glob API
import.meta.globAPI can dynamically import files, allowed in Vite3import.meta.glob has been rewritten. For details, please refer to Glob import form, which is described in great detail in the official documentation.
Other contents
Vite3.0 has also updated some other contents, as follows:- The overall size of Vite has become smaller ;
- The JS and CSS compression tools use ESbuild (starting in Vite2);
- Fixed multiple bugs;
- Compatibility has been adjusted,
The minimum support is node14.18 ;
- Vite decides
to release a new version every year ;
Written at the end
This article briefly introduces some new features in Vite. Now the speed of front-end development has become very fast.Only by always maintaining sensitivity to new technologies can you ensure that you will not be eliminated, Come on everyone~
Finally, I wish you all: Don’t work overtime every day, and your annual salary will be over one million. [Related video tutorial recommendations:vuejs entry tutorial, web front-end entry]
The above is the detailed content of Vite3.0 is released, take a look at the new features of Vite3.0. For more information, please follow other related articles on the PHP Chinese website!
How to provide and inject dependencies in Vue 3?Jul 21, 2025 am 03:40 AMIn Vue3, dependency injection is implemented through provide and inject, supporting data passing across levels. 1. Use provide to provide data or methods in the parent component, and inject is obtained in the child component; 2. Provide responsive state and maintain variability through exposing methods; 3. Use Symbol as key to avoid naming conflicts; 4. Injected values can be used in contexts outside the setup, such as instructions, but make sure that inject has been called in the setup. This mechanism is suitable for plug-in development, theme configuration and global state management, making component communication clearer and more efficient.
Vue router not working after build (404 on refresh)Jul 21, 2025 am 03:38 AMRefreshing the page after deploying the Vue project returns 404 because VueRouter's history mode is used but the server is not configured correctly. 1. Confirm whether history mode is used. In this mode, the path such as /about will request resources from the server; 2. Configure the server to redirect all requests to index.html, for example, add try_files$uri$uri//index.html in Nginx, Apache uses .htaccess rules, Vercel or Netlify to set rewrite rules; 3. Check whether the deployment path is correct. If deployed in a subpath, you must set the correct publi in vue.config.js.
How does Vue's Virtual DOM diffing algorithm work?Jul 21, 2025 am 03:31 AMVue's virtual DOMdiff algorithm improves performance by comparing old and new virtual DOM trees to minimize real DOM operations. 1. When the data changes, Vue re-renders the component into a virtual DOM tree, which is a lightweight and fast and operational JavaScript object; 2. Vue uses an O(n) complexity heuristic algorithm to compare new and old virtual DOM trees, and replaces them if the node types are different, and updates attributes if the same ones; 3. When rendering the list, use the key attribute to help Vue accurately track element changes and improves diff efficiency; 4. In the end, Vue will batch update the difference to the real DOM, reducing the number of re-arranged and redrawings, thereby maintaining the efficient response of the interface.
Vue watcher example for reacting to data changesJul 21, 2025 am 03:27 AMInVue,awatcherisusedtoreacttodatachanges,especiallyforperformingsideeffects.WatchersareidealforactionslikeAPIcallsorUIupdatesinresponsetodatachanges,unlikecomputedpropertieswhichareforderivingvalues.Tosetupawatcher,defineitinthewatchoptionofacomponen
What is the role of reactivity transform in Vue 3?Jul 21, 2025 am 03:25 AMVue3's responsive conversion simplifies the use of responsive data by automatically unpacking refs. 1. It allows direct use of ref variables in contexts such as template expressions, watch, and computed without the need for .value; 2. After enabling this feature, the deconstructed defineProps() value remains responsive; 3. Applicable only to environments configured with and specific build tool; 4. Not applicable to non-primitive values such as objects or arrays. This feature reduces redundant code and improves the development experience, but may reduce code clarity. Whether it is enabled depends on project requirements and team preferences.
How to use slots and named slots in a Vue component?Jul 21, 2025 am 03:24 AMUsing slots and named slots in Vue can improve component flexibility and reusability. 1. The slot allows the parent component to insert content into the child component through a tag, such as inserting paragraph text into the Card.vue component; 2. The named slot realizes control of the content insertion position through the name attribute, such as defining the header, body and footer areas respectively in the modal box component; 3. The default content can be set in the slot as an alternative when the parent component is not provided, such as the default close button; 4. The # symbol is the abbreviation syntax of v-slot:; 5. It is recommended to use slots reasonably to avoid excessive dependence, and some content can be considered to be implemented through props or scope components.
How do you access the DOM directly in Vue?Jul 21, 2025 am 03:22 AMIn Vue.js, the DOM can be accessed through ref and lifecycle hooks. Use the ref attribute to get element references, such as accessing through this.$refs.myInput in mounted; 1. It is recommended to operate the DOM in mounted or updated life cycle; 2. Using ref in v-for will return an element array; 3. Using ref for components will get component instances, and DOM nodes need to be obtained through $el; 4. Avoid excessive use of ref, give priority to data binding, and only operate the DOM directly if necessary.
Vue build fails with 'JavaScript heap out of memory' errorJul 21, 2025 am 02:55 AMThe solution to the error "JavaScripttheapoutofmemory" in the Vue project packaging error is as follows: 1. Increase the Node.js memory limit, use the --max-old-space-size parameter to increase the memory limit, such as node--max-old-space-size=4096vue-cli-servicebuild, and configure scripts in package.json; 2. Check dependencies and plug-ins to avoid introducing large libraries, closing production environment sourcemap, and optimizing loader configuration; 3. Enable webpack subcontracting mechanism, configure splitCh in vue.config.js


Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Zend Studio 13.0.1
Powerful PHP integrated development environment

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software








