Fireship · @fireship
Vite in 100 Seconds
Uploaded February 23, 2022 · Length 2:29
Summary
veet simplifies front-end web app development with instant code loading and hot module replacement.
- veet
- javascript build tool
- front-end development
- instant code loading
- hot module replacement
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
veet a javascript build tool that
- 0:02
simplifies the way we build and develop
- 0:04
front-end web applications at its core
- 0:06
it does two things one serve your code
- 0:08
locally during development and two
- 0:10
bundle your javascript css and other
- 0:12
assets together for production there are
- 0:14
many other tools out there that do the
- 0:16
same thing like webpack so what makes
- 0:18
vee different well it was created by
- 0:20
evan yu who also created vue.js as a way
- 0:22
to both simplify and speed up the build
- 0:24
process not long ago web developers had
- 0:27
no native way to combine javascript
- 0:28
files together in a modular way this led
- 0:31
to tools like webpack and rollup that
- 0:33
concatenate multiple files together into
- 0:35
a single bundle for the browser the
- 0:37
problem is that this process becomes
- 0:38
increasingly slow as the app adds more
- 0:40
code and dependencies in 2015 ecmascript
- 0:43
modules were introduced and by 2020 had
- 0:45
wide browser support allowing developers
- 0:47
to import and export code from different
- 0:50
files in the browser veed leverages
- 0:52
native es modules in the browser to load
- 0:54
your code instantly no matter how large
- 0:56
the app is it also supports hot module
- 0:58
replacement for an extremely fast
- 0:59
feedback loop during development when
- 1:01
building for production it uses roll up
- 1:03
under the hood so you don't have to
- 1:04
worry about configuring it it's an
- 1:06
opinionated tool that provides
- 1:07
conventions that work out of the box for
- 1:09
the majority of developers to get
- 1:10
started run npm netweat from the command
- 1:13
line and choose a starter project with
- 1:14
your favorite front-end framework you'll
- 1:16
notice the project comes with a v-config
- 1:18
file it has a plug-in ecosystem that can
- 1:20
extend it with additional features and
- 1:22
you can also manually override the
- 1:24
roll-up defaults when necessary and
- 1:25
there are some really cool plugins out
- 1:27
there like vtssr that can do server-side
- 1:29
rendering like next.js now to serve the
- 1:31
application locally run npm run dev even
- 1:34
if i install a bunch of big dependencies
- 1:36
like low dash and moment the time to run
- 1:38
the dev server does not change now if
- 1:39
you open the network tab in the browser
- 1:41
dev tools you'll notice that instead of
- 1:42
importing a single javascript bundle
- 1:44
file it's importing our actual source
- 1:46
code like a raw tsx file in this case it
- 1:49
also makes typescript about 20 to 30
- 1:51
times faster because it skips type
- 1:52
checking and uses es build to transpile
- 1:55
your code now as you're developing your
- 1:56
app you might change the state of it in
- 1:58
the ui then realize that some of the
- 1:59
code needs to change when you modify the


