In this lecture, we are going to install Web pack for creating and development server, compiling rust
and bundling our files.
You may be familiar with Web Pack.
It's commonly used by frameworks like React, Angular or Vue.
If not, let's quickly talk about Web Pack in the resource section of this lecture, I provide a link
to the official site for Web Pack.
Web Pack is a tool for optimizing JavaScript projects to developing an application takes hundreds of
files.
Splitting your project into separate files is great for development for production.
It's not ideal.
Downloading a web app should be as fast as possible to guarantee the fastest download time.
The size of our app should be small.
Web Pack can help us by minimizing, concatenating and optimizing our project.
Projects can go from hundreds of files to about a dozen files.
But wait, there's more.
Web Pack can compile other languages like rust.
We're going to be using Web Pack to help us automate the process of compiling our code.
It's going to take a lot of work to get the desired behavior, but it's going to be worth it.
Any time we make changes to our project, web pack will automatically compile our code.
Let's get started.
Open your project in your editor.
The first step is to initialize 21:00.
This course assumes you have some knowledge of JavaScript.
Therefore, I expect you to know what npm is.
We aren't going to cover the basics of node or npm in this course.
Inside the command line, we can initialize npm with the following commands npm init minus y.
This command will create a package file.
We're going to need to keep track of our dependencies.
Next, we can begin installing web pack inside the command line.
Run the following commands and p.m. install minus DX Web Pack Web Pack Seelye Web Pack Dev Server.
We are installing three packages for Web Pack while the installation is running.
Let's talk about these three packages.
Web pack is a modular library.
It's packed with features for handling various types of projects.
While that's great and all, we may not need every single feature.
We are encouraged to download what we need.
The first package is called Web Pack.
It's the core functionality of Web Pack.
In almost all cases, you will need to download this package for bundling files.
Up next, we have the Web Pack Seelye package.
This package is a tool with dozens of commands for controlling web pack through the command line.
It also has other tools for working with plugins, which can be helpful if you want to develop a plugin
for Web Pack.
Lastly, we have the development server WebAssembly does not work with.
The file protocol files must be delivered via a server.
Paying for a server is not ideal for development.
Luckily, this package will prepare a server on our local machines.
We don't need to write server side code to start a development server.
These dependencies will be enough for working with Web Pack.
Once you're finished downloading those dependencies, let's start configuring Web Pack in the next lecture.