Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Webpack 5 and Vite: A New Way to Learn - Active Thinking
Rating: 4.5 out of 5(101 ratings)
757 students

Webpack 5 and Vite: A New Way to Learn - Active Thinking

Learn by "Guessing"; Understand Webpack Better by Learning Vite; Master Vite based on Webpack Experience.
Created byOnlyKiosk Tech
Last updated 9/2022
English

What you'll learn

  • Master Webpack 5 and Webpack DevServer
  • Master Vite
  • Master Webpack and Vite library
  • Master Webpack Module Federation

Course content

4 sections44 lectures4h 27m total length
  • Active Thinking: Exploring Webpack By Guessing15:49

    In this lesson, we will create our first Webpack project. But do NOT read the manual yet! Feel in the darkness and make guesses based on common sense. This process forces you to think for yourself. You will be rewarded with a deeper understanding of Webpack.

    We won't create any config file; instead, we will adapt our source files to meet the default setting of Webpack. This way, you will develop a deeper understanding of how Webpack works.

  • Active Thinking: Reverse Engineering the Webpack Config File11:17

    In this lesson, we will create our first Webpack config file.

    Do NOT read the manual! Try to reverse-engineer based on what we have learned about Webpack in the previous lesson. The error messages and warnings are your best friend. They help you figure out what's wrong and what Webpack expects.

  • Webpack Introduction (the Traditional Approach)9:12

    This is the original first Webpack lesson, where we teach Webpack from ground zero, directly telling what to do and what to avoid.

    But doing so deprives you of the opportunity for active thinking. Passively receiving information is not the best way to learn.

    If you are completely new to Webpack and find the previous two lessons too challenging, you can watch this lesson instead.

  • Webpack Watch & WatchOptions6:04

    In this lesson, we will show you how to limit the range of files monitored by Webpack. Watching fewer files lowers the burden of Webpack, improving the overall performance.

  • Webpack Dev Server5:02

    The webpack dev server monitors source files and automatically re-bundle.

  • Static Files4:52

    The "public" directory is where Webpack serves static files.

  • Deduplication3:31

    In the final bundled file, the same code only has one copy. Removing duplicated codes helps reduce the size of the bundled file.

  • Multiple Entry Points4:12

    Multi-page application.

  • Tree Shaking2:52

    Unneeded codes from source files won't show up in the bundled files. This is known as tree shaking, a measure to reduce the size of bundled files.

  • Side Effects4:08

    Despite its name, the side effect is not a bad thing and can be easily avoided.

  • ES6 Dynamic Module Crash Course2:43

    This is a preparation course for lazy loading. Lazy loading is built on the ES6 dynamic import.

  • Lazy Loading6:42

    "Lazy loading" means only loading a file when it is needed. It is built on the ES6 dynamic import. Webpack detects the ES6 dynamic import automatically and "lazy loads" the dynamically imported file.

  • splitChunksPlugin6:57

    The "splitChunksPlugin" is a native Webpack plugin. It splits codes from the bundled JS and injects them into an independent file. It enables lazy loading.

  • htmlWebpackPlugin5:36

    The "htmlWebpackPlugin" is a third-party plugin. It helps generate an HTML file to host the bundled JS file.

  • htmlWebpackPlugin: Multiple Pages5:46

    The "htmlWebpackPlugin" supports multi-page apps. It can generate several HTML files to host different bundled JS files.

  • Webpack.ProvidePlugin4:07

    This plugin helps make a dependency, mainly an NPM package, global. But it is recommended you do not use this plugin.

  • Webpack Asset Modules8:19

    In this lesson, we will you how to deal with non-JS files. "File-loader," the previously most commonly used Webpack loader, has been replaced by "asset modules." The "raw-loader" and "url-loader" have been replaced as well.

  • Asset3:08

    In this lesson, we will show you how to convert a file into a data URI.

  • Asset Modules Public Path6:01

    We can set a custom public path in every "asset mdule."

  • CSS3:35

    In this lesson, we will learn how to work with CSS files. We retrieve CSS codes and inject them into the "style" tag.

  • Minimizing CSS3:48

    In this lesson, we will inject retrieved CSS codes into independent CSS files. In the meanwhile, the retrieved CSS codes will be minified to reduce the file size.

  • On-demand CSS3:35

    A CSS dependency of a "lazy-loaded" file will be "lazy-loaded" as well.

  • SASS2:01

    The bundling process can incorporate the translation of syntax. For example, we can "bundle" a SASS file into an ordinary CSS that can be understood by browsers.

  • PublicPath and Deployment11:21

    The "public path" decides how bundled files are deployed. 

  • Separate Config Files9:09

    Very often, we need different configurations for the dev server and the final bundling. In this case, we can split the config file.

  • Challenge: HTML File as Static Asset6:23

    A challenge to test your command of Webpack.

Requirements

  • Basic JavaScript knowledge
  • Basic NPM knowledge

Description

This course teaches both Webpack and Vite, but we did not just stack a Webpack course and a Vite course together.

We want to help you master Webpack with less time and effort. This is why we add a Vite course.

Studying Webpack lays the foundation for the following Vite study. Your Webpack experience enables you to instantly understand similar concepts in Vite. As a result, you can master Vite with much less time and effort.

Meanwhile, learning Vite gives you the perfect opportunity to review and apply your Webpack knowledge.

By comparing the similarities and differences between Webpack and Vite, you can deepen your understanding of both subjects.

"Exploring" in the "darkness."

Instead of directly telling you what to do, this course takes a different approach—“forcing” you to figure things out by yourself. You will not only learn how but also know why.

Since Webpack 4, a config file is no longer needed. This, of course, is just a marketing gimmick, something Webpack does to attract more new users by appearing to be simple and convenient.

We take advantage of this feature. We will create a project and adapt it to meet the default Webpack settings. In this process, you will develop a more accurate and much deeper of how Webpack works and how to configure it.

If you prefer the old way of learning, where I give you detailed instructions on how to do everything, we have got you covered. We have prepared a traditional Webpack entry lesson, which teaches everything step by step.

Who this course is for:

  • JavaScript developers who want to learn Webpack 5
  • JavaScript developers who want to learn Vite
  • Webpack developers who want to learn Webpack module federation