Vite Crash Course | Faster Alternative To CRA

  Рет қаралды 175,725

Traversy Media

Traversy Media

Күн бұрын

In this video, we will talk about the Vite JavaScript build tool. We will also compare it to Webpack as well as Create React App.
💻 Blog Post:
www.traversymedia.com/blog/vi...
⭐ All Courses:
traversymedia.com
💖 Show Support
Patreon: / traversymedia
PayPal: paypal.me/traversymedia
👇 Follow Traversy Media On Social Media:
Twitter: / traversymedia
Instagram: / traversymedia
Linkedin: / bradtraversy
Timestamps:
0:00 - Intro
1:13 - Vite vs Traditional Module Bundlers
3:50 - Vite vs Create React App
7:14 - Setting Up a Project
8:21 - File & Folder Structure
11:27 - Creating a React Component
12:23 - Environment Variables
13:50 - Using Sass
14:50 - Build For Production & Preview
15:19 - Plugins

Пікірлер: 138
@bryan6090
@bryan6090 Жыл бұрын
HOW this is the third time I needed to learn a particular language quick and when I get ready to study it, you've released a video
@TraversyMedia
@TraversyMedia Жыл бұрын
Magic 🪄
@ZaidMarrie
@ZaidMarrie Жыл бұрын
I just got started with Vite today, and I just got a notification for this vid. It is magical lol.
@LtdJorge
@LtdJorge Жыл бұрын
Always happened to me, a couple years back
@aritramukherjee
@aritramukherjee Жыл бұрын
💯 exactly same for me
@hasithadhananjaya2806
@hasithadhananjaya2806 Жыл бұрын
​@@TraversyMedia what's the npm i command usage in this video please describe it little more.
@anonymousontheinternet4486
@anonymousontheinternet4486 11 ай бұрын
Just got started with Vite. Wanted a really quick intro so I could jump into it and not have to waste time watching a 2hr tutorial. This was perfect. Anything I need, I'll learn on the way.
@RustyNox
@RustyNox Жыл бұрын
Hey Brad, this was really useful to me, thank you for the long-form content on Vite, super clear explanation, love your style!
@isaacqadri
@isaacqadri Жыл бұрын
The future of frontend tooling is here, thank you Brad.
@haciendadad
@haciendadad Жыл бұрын
Thanks Brad! A replacement for CRA has been a long overdue! Vite looks really cool and excited to use it; starting today.
@voidmind
@voidmind Жыл бұрын
The developer experience is so much better! No more having to wait for the code to rebuild, and often you won't have to reload the whole component tree
@padeen2683
@padeen2683 Жыл бұрын
Exactly at the moment when I wanted to search for "vite tutorial" this showed up. Great timing!
@rafaelalstent4974
@rafaelalstent4974 Жыл бұрын
Thank you so much for making a informative video about a good replacement for CRA. The video is great, we have the theory and the practice. Couldnt ask for more. Thank you c:
@Salah-YT
@Salah-YT Жыл бұрын
thank u so much Mr Brad it was an amazing video about Vite Thank u so much, and I did %50 the javascript course on ur website so I love it thank u so much for all staff
@setfbiker
@setfbiker Жыл бұрын
It always feels special when I see a notif about a new video from you.
@walidbelfatmi9333
@walidbelfatmi9333 Жыл бұрын
As expected of Brad, the best explanation. Thank u !
@Ryguy12543
@Ryguy12543 4 ай бұрын
excellent tutorial, I followed along without a single issue. thank you so much.
@krupeshanadkat635
@krupeshanadkat635 Жыл бұрын
You just made my life so cheerful ❤ I was in little panic when i heard new react docs got rid of cra & now they have mentioned to use next js by default. CRA official github repository also seems inactive. I did not want to learn Next js right now, but would still love to enjoy react on new projects without setting up things manually. This video really gave me confidence back.
@marcioandre6469
@marcioandre6469 11 ай бұрын
🤣🤣Same here
@rangabharath4253
@rangabharath4253 Жыл бұрын
Awesome as always Brad. Thanks 😊
@saranghae3720
@saranghae3720 Жыл бұрын
Love the way, how you present things....
@estherinyang4779
@estherinyang4779 5 ай бұрын
I wish I could like this a million times. Thank you so much!
@ward7576
@ward7576 7 ай бұрын
I am glad I found this clip. I actually didn't enjoy Vite at first. Felt confusing... you know why? With webpack and other solutions got used to the fact that I have to define paths to bundle-able assets, a lot of other boilerplate config beforehand, specific production config and optimizations that you have to set up - I was looking for that in Vite and got super confused when I found nothing like it. This has been the best switch I have done in build tools, ever.
@yahayaoyinkansola8258
@yahayaoyinkansola8258 7 ай бұрын
Vite is really cool, i love the way it is so lightweight, giving the developer more control, and making the dev experience more enjoyable
@daydreamical
@daydreamical Жыл бұрын
Thank you so much for this video, was very useful, definitely learned a lot! Thanks!
@samuelnkrumahbonsu7210
@samuelnkrumahbonsu7210 11 ай бұрын
Thanks for doing staff like this vitejs for some of us. Appreciate that a lot. Am learning bro. Thanks
@akashddeepchitransh4537
@akashddeepchitransh4537 Жыл бұрын
Amazing video, exactly what I needed.
@sarahjeannexd
@sarahjeannexd Жыл бұрын
I LOVE VITE
@rod6722
@rod6722 Жыл бұрын
Sweet! I just started using it.
@raekwonthachef
@raekwonthachef Жыл бұрын
Amazing video Brad! so succinct :)
@arianh
@arianh Жыл бұрын
It was a great video in order to get our hands dirty using Vite 👏🏻💯
@marouaniAymen
@marouaniAymen Жыл бұрын
Thanks for the video, but it'd be better if it shows how to configure ESLint and add rules to the project and also how to add settings for unit tests (vitest or react-testing-library).
@Ryan-Phillips2.0
@Ryan-Phillips2.0 11 ай бұрын
Would be nice with more Vite tutorials. Like setting up navbar and routing.
@omomer3506
@omomer3506 Жыл бұрын
Excited to learn about vite
@SameeraSenarathna
@SameeraSenarathna Жыл бұрын
Really helpful content. Thank You.
@naveenbelandur9952
@naveenbelandur9952 Жыл бұрын
Thanks a lot, traversy media, for this
@wwhill8033
@wwhill8033 Жыл бұрын
Excellent stuff, thanks😊
@marouabenali1321
@marouabenali1321 3 ай бұрын
Thank you, it was very helpful
@naturecultureafrica
@naturecultureafrica Жыл бұрын
Great ! Simple and clear ~ Next time, could you do the same but including, nextjs, node and Mongo DB?
@Samuels691
@Samuels691 5 ай бұрын
I enjoyed this! Thanks
@code_with_sheynet
@code_with_sheynet Жыл бұрын
Thanks very much my mentor
@sanjaybatak3549
@sanjaybatak3549 Жыл бұрын
Did Brad just upload a Crash Course from his hotel room? lol 😂 Thanks Brad. Keep up the good work!!
@user-jv6xc9sl3l
@user-jv6xc9sl3l Жыл бұрын
Ive been waiting for this!
@Uthalerebaba-nr4qi
@Uthalerebaba-nr4qi 8 ай бұрын
- [00:00](kzbin.info/www/bejne/bmqxe5eYjrmagJo) 🎥 This video is a Vite crash course, covering its benefits and how it compares to traditional build tools like webpack. - [01:20](kzbin.info/www/bejne/bmqxe5eYjrmagJo) 🧩 Webpack is a traditional module bundler that bundles development source code into a single JavaScript file for production use. - [02:44](kzbin.info/www/bejne/bmqxe5eYjrmagJo) 🚀 Vite, unlike webpack, leverages native ES modules in modern browsers for faster development, avoiding repetitive bundling during code changes. - [03:38](kzbin.info/www/bejne/bmqxe5eYjrmagJo) 📦 Vite uses Rollup for production bundling, making it a fast alternative for development compared to webpack or parcel. - [04:20](kzbin.info/www/bejne/bmqxe5eYjrmagJo) 💡 Vite is gaining popularity as an alternative to create-react-app, offering speed advantages for front-end development. - [07:02](kzbin.info/www/bejne/bmqxe5eYjrmagJo) 🛠 Setting up a Vite project is easy using a simple command like `npm create @latest`. You can choose different templates and frameworks like React or Vue. - [08:24](kzbin.info/www/bejne/bmqxe5eYjrmagJo) 📄 Vite project structure is lightweight and simple, with a minimalistic `package.json` and straightforward configuration. - [12:24](kzbin.info/www/bejne/bmqxe5eYjrmagJo) ♻ Vite offers Hot Module Replacement (HMR), allowing changes in code to be reflected immediately without requiring a full rebuild. - [13:49](kzbin.info/www/bejne/bmqxe5eYjrmagJo) 🔧 You can easily set up environment variables like API URLs in a Vite project. - [14:07](kzbin.info/www/bejne/bmqxe5eYjrmagJo) 🎨 Vite supports SCSS out of the box, making it simple to add and use CSS preprocessors in your project. - [15:05](kzbin.info/www/bejne/bmqxe5eYjrmagJo) 🏗 Building a Vite project for production is straightforward with the `npm run build` command, and you can preview the production build with `npm run preview`. - [16:10](kzbin.info/www/bejne/bmqxe5eYjrmagJo) 📚 Vite offers official and community plugins that extend its functionality, allowing for integration with various tools, libraries, and frameworks.
@abdellahdamri656
@abdellahdamri656 Жыл бұрын
Hi brad Great Stuff! I just been wandering could we use it to build our own Frontend Framework?
@khandoor7228
@khandoor7228 Жыл бұрын
Thanks Brad!
@hassaneoutouaya
@hassaneoutouaya 5 ай бұрын
Thank you so much !
@otmanm4095
@otmanm4095 9 ай бұрын
Brad never disappoint
@sasabaid
@sasabaid Жыл бұрын
@TraversyMedia Loved the video. Can you also share the extensions u used for those autocomplete of imports, vite configs on ur vscode
@warisaremou8754
@warisaremou8754 Жыл бұрын
Thanks for the video 😀🙏 How can I update vite version in an existing vite-react app Also can we have ( maybe later ) a video on how to set up pwa with vite-react app ? 🙏
@evansatompoya7351
@evansatompoya7351 Жыл бұрын
For the environment variables section, when you run tests on your react application, you get cannot use import.meta outside a module even though I define type="module" in my package.json. so what I did was, reversed engineered vite to use the process keyword instead of import.meta. so I can now do something like process.env.API_URL. But the issue with the process keyword is that, in production, I get process is not defined since the process keyword is not accessible in browser environments. How do I get around this
@user-kn7tc3pp2c
@user-kn7tc3pp2c 11 ай бұрын
The idea isn't about getting slow, but taking too much resources. for someone like me just started and not having the best laptop or computer tool like create-react-app is really heavy on my machine and take a lot of resources ram, cpu, ... to run, so the idea is simplicity and using resources as minimum as possible
@warrenmcinnes987
@warrenmcinnes987 Жыл бұрын
Hi Brad. How did your VS code auto-suggest @12:01? Was it co-pilot?
@elhaambasheerch7058
@elhaambasheerch7058 Жыл бұрын
"Through out this video It might seem like I'm bashing CRA but actually I'm just talking about vite", COLD.
@afgone123456
@afgone123456 Жыл бұрын
What theme do you use for vsc?
@hip04hop85
@hip04hop85 Жыл бұрын
Right on time!
@DragonFruit9k
@DragonFruit9k Жыл бұрын
Hi, how can we setup testing library and jest, or is there better solution for testing?
@abhinavv_sharmaa
@abhinavv_sharmaa Жыл бұрын
What's the theme you are using in the VS code?
@gururajmoger8649
@gururajmoger8649 Жыл бұрын
Pls do it for angular projects also 👍
@faizanahmad9850
@faizanahmad9850 Жыл бұрын
Thank u Brad
@anthonysmith7913
@anthonysmith7913 11 ай бұрын
Thanks a lot!
@arthurhakobyan7343
@arthurhakobyan7343 Жыл бұрын
what is the name of the vs code theme and the icon pack that you are using ?? thanks )))
@user-zr7ve3ut5t
@user-zr7ve3ut5t Жыл бұрын
When working with huge scss files, vite can also get fairly slow. It even crashes sometimes.
@mahad7966
@mahad7966 Жыл бұрын
Try tailwind instead.
@thusithanjana
@thusithanjana Жыл бұрын
Thanks!
@jediampm
@jediampm Жыл бұрын
Hi, make a video on your thoughts about the new react docs and the fact they recommend nextjs and others related frameworks. Is this good for beginners?
@WrestlingTournamentsDotCom
@WrestlingTournamentsDotCom 9 ай бұрын
Vite is awesome. Our build time got so much faster when we switched to it from webpack. Until this video, I've pronounced it to rhyme with "byte", whoops.
@sicfxmusic
@sicfxmusic 4 ай бұрын
More like wheat than white 😉
@lauralong3091
@lauralong3091 22 күн бұрын
i love these videos.
@NiPSpawN
@NiPSpawN Ай бұрын
Hi, how are called the theme you used in that video? Also what extension you use for vs code?
@faruqoloyede9772
@faruqoloyede9772 Жыл бұрын
Wow just saw an article about this vite
@faizanahmad9850
@faizanahmad9850 Жыл бұрын
Hi, Brad I have enrolled in your MERN stack app course in udemy should I continue with same. Or it will get updated
@user-iz8xn5mh1j
@user-iz8xn5mh1j 4 ай бұрын
It could have been fantastic if you had incorporated testing with Vite as well.
@ScriptRaccoon
@ScriptRaccoon Жыл бұрын
3:21 I think this is not correct. esbuild is not used to serve ES Modules. As you say in the video, this is what the browser just does for us. esbuild is a module bundler. It is used to pre-bundle depencencies, and also when you run build the Vite application.
@CandidoZfinda
@CandidoZfinda 3 ай бұрын
Very good
@code_with_sheynet
@code_with_sheynet Жыл бұрын
You give me Hope that i will be great in Tech space
@TraversyMedia
@TraversyMedia Жыл бұрын
If I can, you can. As long as you have the drive 💪
@code_with_sheynet
@code_with_sheynet Жыл бұрын
I have been learning DevOps this year, But my learning roadmap is getting distracted. What can i control that Brad? Please do a tutorial series on DevOps using Docker.
@code_with_sheynet
@code_with_sheynet Жыл бұрын
​@@TraversyMedia I have been learning DevOps this year, But my learning roadmap is getting distracted. How can i control that Brad? Please do a tutorial series on DevOps using Docker.
@tanmaypanadi1414
@tanmaypanadi1414 Жыл бұрын
you can look at books and content from Tech world with Nana and Jeff geerling they have some awesome tutorials on KZbin.
@Cod3rMax
@Cod3rMax 4 ай бұрын
What are the icons you are using and theme?
@aaliraza4004
@aaliraza4004 Жыл бұрын
hi, how we use Context API in Vite thankyou ...
@abukhalidrifat3994
@abukhalidrifat3994 Жыл бұрын
I am getting an error while choosing react with JavaScript and swc. The error says "[vite] Internal server error: Bindings not found"
@hugo-abdou
@hugo-abdou Жыл бұрын
is this the introduction of the course or this is the course i was excpecting more lool
@DeoMaido
@DeoMaido Жыл бұрын
Videos have worked for me but how can I make my website fix on small device's
@ThomasProsserZurich
@ThomasProsserZurich Жыл бұрын
Thanks for this! I like vite precisely for its quickness. The only reason it took me so long to switch over: Dang they need a different logo! This one is just ugly.
@tigrafale4610
@tigrafale4610 Жыл бұрын
Cheers
@QueeeeenZ
@QueeeeenZ Жыл бұрын
I love Vite, its like million times faster than Webpack
@labialkosta261
@labialkosta261 Жыл бұрын
Hey Brad !! thanks for Uploading, i have a question for you or the audience here, everytime i hear about upgrading a software or a website, they say it's need funding wich mean money, so how upgrading software or a website need money, it's just coding that all. because i recently heard about twitter and he will be upgrading his source code and they say that it's will take a lot of money. So any explanation please ?
@TraversyMedia
@TraversyMedia Жыл бұрын
There are many areas of cost. Developers, project managers, marketers, infrastructure. As applications grow, so do the technology demands.
@badziobw
@badziobw Жыл бұрын
Someone has to design this code and someone has to write it, thats the biggest chunk of cost. Im sure you don't do your work for free either?
@labialkosta261
@labialkosta261 Жыл бұрын
@@badziobw i understand thanks but i talking about upgrading with existing workers, but you already have answered the questions thanks a lot
@labialkosta261
@labialkosta261 Жыл бұрын
@@TraversyMedia thanks brad for the information ℹ
@tanmaypanadi1414
@tanmaypanadi1414 Жыл бұрын
As I understand during upgrades there is high possibility of broken code base, bugs , while the existing code is tested and proven to stand the test of time.
@xcrxwadda8287
@xcrxwadda8287 Жыл бұрын
I was using CRA, but lately am using Vite it's fast and never looking back
@alexanderkomanov4151
@alexanderkomanov4151 Жыл бұрын
Cool!
@pav2k
@pav2k Жыл бұрын
Please make Solidity crash course!
@Ahmed-fq3kz
@Ahmed-fq3kz 11 ай бұрын
thanks man
@paulthomas1052
@paulthomas1052 Жыл бұрын
Thanks - great demo.
@techiesakar
@techiesakar 6 ай бұрын
Why npm run preview shows blank white page ?
@Virtualexist
@Virtualexist Жыл бұрын
Hi people! I am completely new to learning react, I bought a udemy course, and they are teaching with CRA, should I continue or shift to VITE? I do not have enough information to make a decision, lemme know? plesss.
@crizwiz489
@crizwiz489 Жыл бұрын
Can you please create a crash course on react with typescript
@omomer3506
@omomer3506 Жыл бұрын
So does that mean you can't use vite with certain older browsers
@vibhavvolvoikar901
@vibhavvolvoikar901 Жыл бұрын
Sir please make one video on Pinia
@warpmaster7
@warpmaster7 Жыл бұрын
will vite work with certain backends like django?
@LtdJorge
@LtdJorge Жыл бұрын
You mean for the frontend side?
@mdkawsarislamyeasin4040
@mdkawsarislamyeasin4040 Жыл бұрын
Kindly create a video about how to configure vite
@scottonanski4173
@scottonanski4173 7 ай бұрын
But this really doesn't tell us what to do with the mess of truncated code that doesn't run on a host after it's been uploaded.
@omojjegomosc8211
@omojjegomosc8211 10 ай бұрын
Vite is showing a blank page after using routing, anyone has the same problem?
@PuRpLeIzLeGiTx
@PuRpLeIzLeGiTx Жыл бұрын
🎉
@chesterxp508
@chesterxp508 3 ай бұрын
GoodJob!
@jopadjr
@jopadjr Жыл бұрын
2.2k+...Thanks
@kasper369
@kasper369 Жыл бұрын
My brain says to use vite but my heart says to use webpack
@nivethan_me
@nivethan_me Жыл бұрын
listen to your brain 😉
@amansaxena4827
@amansaxena4827 Жыл бұрын
👍
@luisbrazilva
@luisbrazilva 11 ай бұрын
I get it. It's fast but why is everyone ignoring the huge security risk of exposing your API connections and key because it serves the JSX files in the network activity tab without masking them or encoding them.
@kaos092
@kaos092 7 ай бұрын
All code on the client is exposed no matter what bundler or library / framework you use.
@shamshad_hussain
@shamshad_hussain Жыл бұрын
make video on vite react SSR and deploy
@eliass1862
@eliass1862 Жыл бұрын
but cant minify html...
@HiddenWorldsLLC
@HiddenWorldsLLC 11 ай бұрын
even the react devs agree that CRA (Create React App) is not the right way to make a project anymore, that is why they removed CRA from the React Docs.
@AB-kq9xm
@AB-kq9xm 11 ай бұрын
it's still in the docs
Learn Vite with Evan You
13:35
Vue Mastery
Рет қаралды 254 М.
ЗРЯ Я 24 ЧАСА СТОЯЛ НА ГВОЗДЯХ! #нонале
00:35
Điều cuối cùng mẹ có thể làm cho con || Sad Story  #shorts
01:00
Vite: The Death of Webpack? 😨
10:37
Mehul - Codedamn
Рет қаралды 37 М.
This AI steals programming jobs... let's try it
10:39
Master Codebender
Рет қаралды 3,4 М.
Every React Concept Explained in 12 Minutes
11:53
Code Bootcamp
Рет қаралды 234 М.
You might not need useEffect() ...
21:45
Academind
Рет қаралды 113 М.
Why is Everyone Using Vite?
7:34
Awesome
Рет қаралды 69 М.
State Managers Are Making Your Code Worse In React
13:33
Web Dev Simplified
Рет қаралды 118 М.
20 Essential VS Code Extensions In 2024
14:26
Traversy Media
Рет қаралды 102 М.
Visual Guide to the Modern Frontend Toolchain (Vite)
9:18
Lachlan Miller
Рет қаралды 70 М.
Why spend $10.000 on a flashlight when these are $200🗿
0:12
NIGHTOPERATOR
Рет қаралды 9 МЛН
iphone X Convert To Iphone 11Pro #iphonex #iphone11pro #shorts
0:13
Technical Mobile
Рет қаралды 4,6 МЛН
phone charge game #viral #tranding #new #reels
0:18
YODHA GAMING RAAS
Рет қаралды 1,1 МЛН