Vite Crash Course | Faster Alternative To CRA

Traversy Media
14 Mar 202316:24

Summary

TLDRThis video introduces Veet, a fast and modern development tool for building web applications. It explains how Veet differs from traditional bundlers like Webpack by leveraging native ES modules for faster development. The speaker demonstrates setting up a React app using Veet, highlights its benefits, including hot module replacement and simple configuration, and compares it with Create React App. The video also covers integrating environment variables, using Sass, and exploring additional plugins for enhancing functionality. Overall, it's a practical guide for developers seeking to streamline their development workflow.

Takeaways

  • 📦 Veet is a modern development tool used for creating JavaScript applications, especially when building larger and more dynamic front-end apps.
  • 🚀 Unlike traditional bundlers like Webpack, Veet does not bundle files during development, which speeds up the process.
  • 🔥 Veet utilizes native ES modules in modern browsers, reducing the need for constant rebundling during development.
  • 📜 In production, Veet uses Rollup, a module bundler, to package files efficiently.
  • 💡 Create React App uses Webpack under the hood, which can slow down development as applications grow in complexity.
  • ⚡ Veet offers much faster build times compared to Webpack because it doesn't rebundle on every code change.
  • 🔄 Veet uses hot module replacement (HMR), allowing developers to see changes in the browser immediately without resetting state.
  • 🌍 Environment variables in Veet can be set using a .env file with the prefix `VITE_`.
  • 🎨 Veet supports Sass out of the box for styling and makes integrating CSS preprocessors easy.
  • 🔌 Veet has a range of plugins, including official ones for React, Vue, and community plugins for various integrations like Electron and PWA.

Q & A

  • What is Veet and why is it important?

    -Veet is a modern build tool that serves as a faster alternative to traditional bundlers like Webpack. It speeds up development by using ES modules directly in the browser and avoids constant rebundling, improving efficiency for modern front-end applications.

  • How does Veet differ from Webpack in development?

    -While Webpack bundles files every time a change is made, slowing down the process as the app grows, Veet uses ES modules and serves code directly to the browser, making development much faster by eliminating the need for constant rebundling.

  • What are the benefits of using ES modules in modern browsers with Veet?

    -ES modules allow developers to use import/export syntax directly in the browser, reducing the need for bundling during development. This makes the process faster and enables real-time updates without delays, as Veet leverages this capability.

  • What is Rollup, and how does Veet use it?

    -Rollup is a module bundler that Veet uses when creating a production build. While Veet acts as a dev server during development, it relies on Rollup to bundle files efficiently for production, ensuring optimal performance.

  • Why might developers prefer Veet over Create React App?

    -Developers might prefer Veet because it offers faster development times due to its ability to serve code directly to the browser without bundling during development. Veet also provides a simpler and lighter setup compared to Create React App, which uses Webpack under the hood and can become slower as the project grows.

  • How does Veet handle hot module replacement (HMR)?

    -Veet's HMR feature ensures that changes made in the code are reflected in the browser without a full page reload or resetting the state. This allows developers to see real-time updates to their applications quickly and efficiently.

  • How do you set up a new React project using Veet?

    -To set up a new React project with Veet, you can run the command `npm create veet@latest`, choose 'React' from the options, and then install the necessary dependencies. The setup process is simple and lightweight compared to other tools.

  • What is the role of the `.env` file in a Veet project?

    -The `.env` file in a Veet project is used to store environment variables. In Veet, these variables are accessed using `import.meta.env`, and the variables must start with `VITE_` to be recognized in the project.

  • Can Veet work with Sass, and how do you set it up?

    -Yes, Veet supports Sass out of the box. To use it, you need to install Sass as a development dependency, create your `.scss` files, and then import them directly into your components, just like you would with regular CSS files.

  • What are some plugins available for Veet, and what are their purposes?

    -Veet offers both official and community plugins, such as plugins for React, Vue, and Svelte. There are also roll-up plugins for additional bundling features and other community-driven plugins for various purposes like Electron, PWA, and server-side rendering (SSR). These plugins extend Veet's capabilities depending on the project's needs.

Outlines

00:00

🚀 Introduction to Veet and Web Development Tooling

This section introduces the video, where the speaker plans to explain Veet, its benefits, and how to use it to create a React application. The speaker touches on the evolution of JavaScript development, especially in the transition from using simple script tags for small projects to modern frameworks that require more complex tooling and file structures. The speaker highlights Veet as a solution to improve bundling and development speed, compared to older tools like Webpack.

05:02

🛠️ The Role of Webpack and Veet in Module Bundling

Here, the speaker discusses traditional bundlers like Webpack, which take multiple JavaScript files, stylesheets, and third-party packages and bundle them into a single file for production. While Webpack has been the standard, its process can slow down development, especially as projects grow. Veet solves this by leveraging native ES modules in modern browsers, avoiding the constant re-bundling process that Webpack requires. Veet is described as a development server, with Rollup handling production builds, making it faster than Webpack for most cases.

10:04

⚡ Veet vs. Create React App: Speed and Efficiency

The speaker dives deeper into comparing Create React App and Veet, focusing on the development process. While Create React App uses Webpack and requires bundling all files with each change, leading to delays, Veet does not need to bundle everything before serving the app. It uses ES build and dynamic code splitting, enabling faster updates to the browser during development. The real-time browser updates in Veet significantly reduce wait times, offering a smoother development experience.

15:05

🌐 Starting with Veet for React Development

This section walks through the steps of setting up a React project using Veet. The speaker demonstrates how to run commands to initialize a new Veet app, select React as the framework, and explore the generated boilerplate code. The simplicity of Veet’s structure, including its lean `package.json` and easy configuration options, is emphasized. The speaker compares this with Create React App, which is more complex, while praising Veet for its simplicity and efficiency.

💻 Code and Hot Module Replacement in Veet

This part explains how to create a basic React component in Veet and demonstrates hot module replacement (HMR). The speaker creates a header component and shows how changes in the code are instantly reflected in the browser without losing the application state, unlike Create React App, where such changes would reset the state. This feature is one of Veet’s key advantages for fast and efficient development.

🔧 Using Environment Variables in Veet

The speaker introduces the use of environment variables in Veet, comparing it to the similar feature in Create React App. By creating a `.env` file, global variables can be defined and accessed across the application. However, in Veet, the prefix `VITE_` is used instead of `REACT_APP_` when defining these variables. This allows for easier handling of API URLs or other global settings in a React project.

🎨 Adding SCSS Support in Veet

This section covers how to integrate SCSS into a Veet project. The speaker installs the `Sass` package as a dev dependency, demonstrates how to create a simple SCSS file, and imports it directly into a React component. Veet’s ability to handle SCSS out of the box is highlighted, showcasing its flexibility and ease of use compared to more complex setups.

🏗️ Building and Previewing the Production Version

Here, the speaker explains how to build a Veet project for production by running `npm run build`. The build process creates a `dist` folder containing optimized files, which can be previewed by running `npm run preview`. The ease and speed of this process are emphasized as key advantages of Veet, compared to older bundlers like Webpack.

🔌 Exploring Veet Plugins and Extensions

The final section introduces plugins available for Veet. The speaker points out that while official plugins are available for popular frameworks like React and Vue, Veet also supports many community and Rollup plugins for additional functionality, such as Progressive Web Apps (PWAs), SSR (server-side rendering), and more. The speaker encourages developers to explore the plugin ecosystem to extend Veet’s capabilities further.

Mindmap

Keywords

💡Vite

Vite is a modern build tool and development server used for front-end development. In the video, Vite is described as a fast alternative to traditional bundlers like Webpack because it doesn't rebundle everything when changes are made during development. Instead, it leverages native ES modules in modern browsers, which makes the development process faster and more efficient.

💡Webpack

Webpack is a popular module bundler for JavaScript applications. It works by taking multiple files from the development environment, such as JavaScript, CSS, or Sass, and bundling them into one or more files for production. The video contrasts Webpack with Vite, explaining that Webpack's process can slow down development as the application grows larger because it rebundles every time a change is made.

💡ES Modules

ES Modules (ECMAScript Modules) are a standard way of using modules in JavaScript, allowing developers to import and export pieces of code between files. In the video, ES Modules are highlighted as a core feature of Vite, enabling it to serve code directly to the browser without needing to bundle it first during development. This improves speed compared to older methods like Webpack.

💡Development Server

A development server is a tool that allows developers to run and test their code in a browser during the development process. Vite acts as a development server that serves ES modules directly to the browser. The video explains how Vite's dev server helps developers by avoiding the need for constant rebundling, which happens in older tools like Webpack.

💡Hot Module Replacement (HMR)

Hot Module Replacement (HMR) is a feature that updates modules in the browser without requiring a full page reload. The video demonstrates how Vite uses HMR to make updates instantaneous in the browser, allowing developers to see changes without losing the state of the application, which improves development efficiency.

💡Rollup

Rollup is a module bundler used by Vite for production builds. It helps bundle JavaScript code into a format that can be deployed to a live website. The video describes how Vite uses Rollup to bundle files when developers are ready to move from development to production, ensuring the final product is optimized for the browser.

💡Create React App

Create React App is a popular tool for setting up React applications with minimal configuration. The video compares Create React App, which uses Webpack under the hood, with Vite, explaining how Vite can be a faster alternative due to its ability to skip the rebundling process during development. However, the presenter acknowledges that Create React App is still a great tool with extensive resources and support.

💡Babel

Babel is a JavaScript compiler that converts newer ECMAScript code into older versions that are supported by all browsers. In the video, Babel is mentioned as part of the Webpack toolchain, where it transpiles code during the bundling process. The presenter explains that while Babel is essential for compatibility, its use in Webpack can slow down development due to constant rebundling.

💡ESBuild

ESBuild is a JavaScript bundler and minifier built for speed. Vite leverages ESBuild during the development phase to pre-bundle dependencies and serve ES modules to the browser. The video points out that this approach makes Vite much faster than Webpack for development, as ESBuild doesn't reprocess everything every time a change is made.

💡Environment Variables

Environment variables are key-value pairs that are used to configure applications in different environments (e.g., development, production). The video shows how to use environment variables in Vite by creating a `.env` file and accessing these variables using `import.meta.env` in the code. This helps developers manage settings like API URLs across various environments.

Highlights

Introduction to Veet as a modern build tool for front-end development.

Explanation of traditional module bundlers like Webpack and their limitations, especially regarding speed as projects grow.

Veet leverages native ES modules in the browser for faster development by not rebundling everything on every change.

Uses ESBuild to serve code directly to the browser during development, skipping the heavy bundling process seen with Webpack.

Veet is faster in development than Webpack or Create React App due to its direct code serving and use of ES modules.

In production, Veet uses Rollup for bundling files, ensuring optimized builds while still being fast.

Create React App is still a good tool with strong support, but Veet offers faster alternatives for modern development.

Initial setup process for a React application using Veet is simpler and the boilerplate structure is lighter compared to Create React App.

Veet supports hot module replacement (HMR) out of the box, meaning changes are reflected immediately without a full page reload.

Simple configuration using environment variables with Veet by using `import.meta.env` instead of `process.env` like in Create React App.

Veet offers out-of-the-box support for using Sass for styling, making it easy to work with CSS preprocessors.

Production build with Veet is quick, and previewing production builds is straightforward with simple commands.

Veet has an extensive plugin ecosystem, including official React, Vue, and Rollup plugins, as well as community plugins for various integrations.

Comparison between Create React App and Veet in terms of file watching and bundling speed, with Veet being significantly faster in development.

Final review of Veet's lightweight structure, fast development cycle, and advantages for modern front-end workflows over older tools like Webpack.

Transcripts

play00:00

foreign

play00:02

[Music]

play00:05

what's going on guys welcome to my Veet

play00:07

crash course so in this video I want to

play00:09

talk a little bit about the what it does

play00:12

what its benefits are and we're going to

play00:14

jump in we're going to spin up a react

play00:16

application look at the the boilerplate

play00:19

that's given to us the starter code and

play00:21

so on and I also just want to talk about

play00:23

Tooling in general because I think it

play00:25

can be confusing to people that are on

play00:29

the kind of the beginner level that have

play00:32

just created their JavaScript files and

play00:34

put them right in the script tag you

play00:36

have one or two files and and that's

play00:38

fine for small projects if you have a

play00:40

website with a little bit of dynamic

play00:42

functionality or you have a really small

play00:44

front-end application that's fine but

play00:46

when you move to using a framework or

play00:49

you're building more modern dynamic

play00:51

interactive interfaces you're going to

play00:54

be using build tools and you're going to

play00:56

need a way to have a larger file

play00:59

structure and have that bundled into

play01:02

your production JavaScript that you can

play01:05

then include include in the browser

play01:07

alright so Veet is one of those tools

play01:09

that can do that now Vita is a more

play01:11

modern way of doing it so before we talk

play01:14

about V it's important that you

play01:15

understand how traditional module

play01:17

bundlers like webpack work so webpack

play01:20

what it does is it takes your

play01:23

development file structure which could

play01:25

be made up of many many JavaScript files

play01:27

they could be classes they could be

play01:29

functions your import your exporting

play01:32

code from some files you're importing

play01:34

into other files you're using npm

play01:36

modules so third-party packages you

play01:39

might have some CSS or SAS you might

play01:42

have you might be using post CSS so you

play01:44

have this kind of large development

play01:47

source code and then what webpack will

play01:50

do is it'll take all of that and bundle

play01:52

it up into sometimes a single Javascript

play01:55

file called like bundle JS or main.js

play01:58

and then that will be included in a

play02:01

script tag in your HTML so that would be

play02:04

a production build and that's what

play02:06

happens when you use something like

play02:07

create react app or view CLI it just all

play02:11

does it under you know under the hood

play02:13

when you use create react app it's

play02:15

actually using webpack under the hood

play02:16

now the issue we have with something

play02:19

like webpack is that when you're in

play02:21

development and you make a change it

play02:23

goes through that bundling that

play02:25

packaging process every single time it

play02:28

uses Babble it transpiles the code and

play02:31

it does it every time which is okay at

play02:33

first but as you're installing more

play02:35

packages and your application grows it

play02:39

starts to get really slow so what Veet

play02:42

does is it works in a different way

play02:44

where

play02:45

in development it's not rebundling

play02:48

everything every time you make a change

play02:50

instead it it takes advantage of the

play02:54

Native es modules in the browser because

play02:56

in modern browsers you can use es

play02:59

modules which is that import export

play03:01

syntax all right so and you can do that

play03:05

by just having a script tag and then

play03:08

putting a a type attribute and saying

play03:11

type equals module and then you can use

play03:14

that syntax so V takes advantage of that

play03:16

in fact it's built on top of something

play03:19

called es build which is actually what

play03:21

is using those es modules and serving

play03:24

your code directly to the browser in

play03:26

development so vid is essentially a Dev

play03:29

server it's not a module bundler now

play03:32

when it comes time to actually bundle

play03:34

your files for production when you run

play03:36

npm run build it uses something called

play03:38

rollup which is a a module bundler all

play03:42

right so V is very fast because it

play03:45

doesn't have to keep rebundling

play03:47

everything like like webpack or parcel

play03:49

now as far as create react app goes I'm

play03:53

seeing a lot of people lately using Veet

play03:55

over create react app you know if

play03:57

they're not using next.js or remix and

play04:01

it is faster in many ways uh I don't

play04:05

like to say one thing is better than the

play04:08

other create react app is a great tool

play04:10

it's been around for a long time so

play04:12

there's a lot of resources there's a lot

play04:14

of support for it I'll continue to use

play04:16

it in courses and tutorials but Veet is

play04:20

a good alternative and there's a react

play04:23

plug-in that you can use that makes it

play04:26

really easy to get set up in fact if you

play04:28

just run the initial command It'll ask

play04:31

you if you want to use just vanilla

play04:32

JavaScript react views felt and we'll go

play04:36

over that we'll see how that works now

play04:39

let's just take a quick look at how

play04:41

something like create react app works

play04:44

which uses webpack under the hood so

play04:47

basically when we first run create react

play04:49

app webpack is going to look at the

play04:51

entry point which is going to be the

play04:53

index.js file and then it'll bundle all

play04:56

the files and modules that are imported

play04:58

in that index.html then it's going to

play05:02

transpile the code with Babel it's going

play05:04

to set up websockets for hot reloading

play05:08

it's going to bundle everything and then

play05:11

it's going to it's going to serve to the

play05:13

browser right if it's you have your Dev

play05:15

server when you run npm start or

play05:18

whatever it is so this is a great

play05:20

process for development but the issue is

play05:22

that create react app has to bundle all

play05:25

the files every time there's a change

play05:27

and this can start to get slow as your

play05:30

application gets bigger it also means we

play05:32

have to wait for the files to be bundled

play05:34

before we can see the changes in the

play05:36

browser now if we look at the Veet

play05:38

process we don't need to bundle

play05:41

everything before starting the server

play05:43

veetuses es build to pre-bundle our

play05:46

files and do code splitting on the Fly

play05:49

and this means that we can start the

play05:51

server and we see our changes in the

play05:53

browser immediately and we don't have to

play05:55

wait for the files to be bundled so this

play05:57

is a huge improvement over create react

play06:00

app so after the app is served to the

play06:03

browser V will then watch for changes

play06:05

and update the browser in real time and

play06:08

it uses the browser to parse the es

play06:11

modules and then it'll bundle files on

play06:13

the Fly and this means that we can see

play06:15

our changes immediately and when your

play06:18

code contains Import and Export

play06:20

statements the browser will request the

play06:22

corresponding files from the server via

play06:25

HTTP alright so that's kind of a just a

play06:28

quick rundown of how Veet works so what

play06:31

I want to do now is jump in and show you

play06:33

how to get started with using Veet for

play06:36

we're going to use react but of course

play06:38

you can use it with vanilla JavaScript

play06:40

or another front-end framework all right

play06:43

guys so this is

play06:44

vjs.dev this is where you can find all

play06:47

the documentation configuration options

play06:49

so anything you need so if we go to

play06:52

guide here it will tell us how to get

play06:54

set up now I do want to mention that I

play06:56

have a blog post at my website that is

play07:00

basically a basically follows along with

play07:02

this tutorial so talks about a lot of

play07:05

the stuff we've already mentioned and

play07:07

then has little Snippets for our

play07:08

commands and the little bit of code that

play07:10

we'll be writing and so on so I'll have

play07:12

the link to that in the description so

play07:15

to get started we can use npm yarn or

play07:17

pnpm so I'm going to open up a terminal

play07:20

here and we're going to run npm create

play07:23

and then Veet at latest and then

play07:26

whatever we want to call the folder I'm

play07:28

just going to call it Veet app now when

play07:30

I run this It'll ask what I want to use

play07:32

as far as a framework or vanilla but we

play07:34

can also add dash dash template

play07:39

template and then I could say react or

play07:41

view or whatever I want to use but I'm

play07:43

just going to run it like this

play07:45

and you'll see the choices that we get

play07:47

vanilla view react preact lit spelled

play07:50

and others I'm going to go ahead and

play07:51

choose react you can use typescript I'm

play07:54

just going to choose JavaScript and then

play07:56

CD into feed app and then from here I'm

play08:00

just going to run vs code

play08:02

and I just want to take a look at the

play08:04

file structure now throughout this video

play08:06

it might seem like I'm bashing create

play08:08

react app and I'm really not I'm just

play08:10

trying to point out the benefits and the

play08:12

features of Veet and one of those

play08:15

features is the very simple boilerplate

play08:17

file structure that we have here so you

play08:20

can see it's very light if we look at

play08:22

our package.json again very light we

play08:24

just have react and react Dom as

play08:27

dependencies as Dev dependencies we have

play08:30

Veet we have the react plug-in because

play08:32

we chose to use react and also our types

play08:35

for react and then as far as scripts go

play08:37

we have our Dev script that's going to

play08:40

go ahead and run Veet which will run the

play08:41

dev server we have our build script to

play08:44

build out our files for production using

play08:46

roll up and then preview will preview

play08:49

our production build once once we run

play08:52

npm run build alright so simple

play08:55

package.json the config again very

play08:58

simple very light all we have here is

play09:01

the Define config helper function that's

play09:03

where we pass in all of our

play09:05

configuration and here we just have a

play09:08

plugins array with react because that's

play09:10

what we're using all right now you can

play09:13

also install other plugins I'll show you

play09:16

that towards the end and then we can

play09:18

have a server object here for our Dev

play09:21

server options and I'm going to set Port

play09:24

3000 because the default I believe is

play09:27

like 51.73 or something like that so and

play09:31

if you want to add a proxy here you can

play09:33

do that as well there's other options

play09:35

you can look at the documentation for

play09:37

that so let's save that file and then

play09:39

we're going to go to our index.html

play09:42

which notice is not in the public folder

play09:45

the public folder is strictly for assets

play09:47

images icons things like that

play09:50

index.html is right in the root and if

play09:53

we look at it it's very simple we have

play09:55

our div with the ID of root just like

play09:57

you would with any react application and

play10:00

then notice the script tag is using this

play10:03

type equals module so this indicates

play10:07

that we're using ES modules in the

play10:09

browser and instead of pointing to some

play10:12

bundled JS file we're actually pointing

play10:14

to our main jsx which is our react entry

play10:18

point so if we look at that that's where

play10:21

react and react Dom are brought in our

play10:24

main app components we have a little CSS

play10:26

file with some default styling and then

play10:29

rendering here from react Dom which is

play10:32

rendering our app component okay and if

play10:35

we look at the app component it's very

play10:37

simple it's just a simple landing page

play10:39

we'll check it out in a minute and it

play10:42

has some state for account and just has

play10:45

a button that's going to increment that

play10:47

count

play10:47

all right so let's go ahead and run the

play10:49

dev server I'm going to open up my

play10:51

terminal and we're going to say actually

play10:53

first of all we have to run npm install

play10:57

which will obviously install Veet and

play11:00

all our dependencies react and so on

play11:04

okay once we do that we can run npm run

play11:07

Dev

play11:10

that's going to open on 3000 and you're

play11:13

going to notice that everything is just

play11:15

really really fast so this is just a

play11:17

basic landing page it's the app.jsx file

play11:20

that I showed you we have this little

play11:21

button here where we click and it just

play11:23

increments the count State okay so what

play11:26

I want to do now is just create a very

play11:29

simple react component so let's create a

play11:32

folder called components and then in

play11:35

there we'll create a file called header

play11:38

let's just say header.jsx and I'll do

play11:42

r-a-f-c-e enter I'm just using the react

play11:45

Snippets extension and let's see we'll

play11:48

just put in here in the div

play11:50

hello world

play11:53

and then let's bring that into our

play11:55

app.jsx so we'll say import

play11:58

header and we'll put the header

play12:01

component right here

play12:03

okay now I'm going to save that and

play12:05

let's go back here and notice now we get

play12:07

hello world and notice that the state is

play12:10

still here that count is 12. it didn't

play12:12

reset to zero when I made a change okay

play12:16

so that's an example of HMR a hot module

play12:20

replacement

play12:21

so another thing that I want to show you

play12:24

is how we can have environment variables

play12:26

so if we go back

play12:29

to vs code and we create in the root

play12:33

okay you want to make sure you're in the

play12:34

root and we're going to have a DOT EnV

play12:37

file and this is something you can do

play12:39

with create react app as well if you

play12:41

have Global variables that you want to

play12:43

be accessible throughout your site then

play12:45

you can have this dot EnV file where

play12:47

with create react app you would do react

play12:50

underscore app underscore and then

play12:53

whatever you know whatever the the key

play12:55

you want to use or the variable you want

play12:57

to use we'll go ahead and use copilot's

play12:59

suggestion of API URL now instead of

play13:04

using react underscore app we say Veet

play13:07

underscore and then whatever the the

play13:09

variable so I'm going to save that and

play13:11

then to use it let's go into our header

play13:14

and to use that let's just replace this

play13:17

hello world we don't do process.env what

play13:21

we do is import.meta so import meta and

play13:25

then EnV and then whatever

play13:28

our variable is so we'll say API

play13:31

underscore URL

play13:34

okay and then if we go back to our home

play13:37

page here we should see that value of

play13:40

the API URL so that's how we can have

play13:43

environment variables now another thing

play13:45

we can do is use SAS out of the box so

play13:49

let's go back

play13:50

and I'm just going to install SAS we do

play13:53

need that as a dependency so we'll

play13:55

install it as a Dev dependency

play13:59

and let's run the server again

play14:04

and what I'll do is go over to here to

play14:07

the source folder create a folder called

play14:09

scss or we could have our SAS files and

play14:13

let's create

play14:15

main.scss I'm just going to add a simple

play14:19

variable

play14:20

of primary color and we'll set that to

play14:23

let's say steel blue

play14:26

and then I'll add that to the body's

play14:28

background color now when I have the the

play14:31

CSS file I can just bring it directly

play14:33

into my component so I can say import

play14:36

and we're going to do dot slash scss

play14:40

slash main dot scss save that and now

play14:44

you can see we have our blue background

play14:46

so it's as easy as that if you want to

play14:48

implement SAS

play14:50

and then when you're ready to build for

play14:52

production you can simply run npm run

play14:55

build

play14:59

okay so very quick and then you'll see

play15:02

there's a disk folder here and if you

play15:03

want to preview that build you can do

play15:05

npm run

play15:07

preview

play15:09

and now that's going to open on this

play15:11

localhost 4173 so this is our production

play15:14

build

play15:16

okay so pretty simple

play15:19

now as far as plug-ins go if you go to

play15:23

the website here and you go to plugins

play15:26

as far as official plugins we really

play15:28

just have the The View plugin

play15:30

react react with swc and then you can

play15:35

also use roll-up plugins because it uses

play15:37

roll up to bundle your files for

play15:39

production and then there's also right

play15:41

here there's a bunch of community

play15:43

plugins so different Integrations you

play15:46

have like electron and

play15:49

all kinds of stuff here pwa Progressive

play15:52

web apps you have loaders you have

play15:54

bundling plugins Transformer plugins

play15:57

helpers so you can take a look at that

play16:00

there's just there's a lot of different

play16:01

things that you can install and use

play16:03

there's even a vet SSR plug-in that you

play16:06

can use for server-side rendering

play16:08

so that's it guys hopefully you enjoyed

play16:10

this as I said there is a blog post to

play16:13

go along with it if you want to if you

play16:15

want to read this and there's there is

play16:17

some extra information that I put into

play16:19

here but uh but that's it guys thanks

play16:21

for watching and I'll see you next time

Rate This

5.0 / 5 (0 votes)

関連タグ
Vite GuideWeb DevelopmentReact SetupJavaScript ToolsBuild ToolsFrontend FrameworksModern JavaScriptWebpack AlternativeFast BuildsDevelopment Server
英語で要約が必要ですか?