1 minute read

Vite 4.0 – New Features and Upgrades

At Qcon International Software Development Conference, Vite 4.0 release date was March 27–29, 2023. So, if your next question is what’s new in Vite 4.0?, I’ve come up with major updates introduced in Vite version 4.0.

Vite 4.0 comes with advanced vite.new

Advertisement

With the help of the command, pnpm create vite, you can easily create a new vite project with any framework. Alternatively, you can use vite.new to open a standard template online. Moreover, you can also run the command pnpm create vite-extra to get access to different templates directly from other available frameworks.

Vite 4.0 introduces a new React plugin using SWC.

One of the best alternatives for React projects after Babel is Speedy Web Compiler (SWC). So, if you’re dealing with the implementation of React Fast Refresh, SWC is the right option for your business project.

Here, we are talking about Vite 4.0, so two advanced plugins help you deal with React projects: @vitejs/plugin-react and @vitejs/plugin-react-swc (new).

Vite 4.0 are fully compatible with modern browsers.

By default, Safari 14 is the browser that is considered to be a modern browser build, especially for wider ES2020 compatibility.

So, you can efficiently use BigInt and nullish coalescing operator for modern builds without transpiling.

Environment Variables with Vite 4.0

Vite 4.0 is the latest version that uses dotenv 16 and dotenv-expand 9. So, for example, you need to wrap value with quotes if you have a value including # or `.

-VITE_APP=xy#za bc

+VITE_APP=”yz#ab cd

Apart from these features, there are some other major upgrades like:

● Vite 4.0 allows you to import CSS as a String.

● With its environmental impact, Vite 4.0 plays a vital role in enhancing the app installation and increasing Vite’s packaging size.

● To provide better performance with collaborators, Vite Core and vite-ecosystem-ci make your vite development process a smooth one.

This article is from: