Module Formats and Loaders Hi, this is Brice Wilson. In this module, I'm going to cover module formats and loaders. We'll see how coupling and agreed upon module syntax with a third-party library that understands that syntax allows you to write clean modular code that doesn't pollute the global scope. We'll get started by talking about the relationship between module formats and module loaders. It's important to understand that they exist independent of each other, even though they're used together. I'll explain what I like to think of as native vs. non-native module formats. We'll then take a close look at the syntax for the two most popular modular formats. They are the Asynchronous Module Definition format and the CommonJS format. We'll also see that these module formats require loaders to actually use them. I'll update the MultiMath app to load AMD modules with a library named RequireJS. I'll then rewrite the code to use CommonJS modules and load them with a library named SystemJS.
Module Bundlers Hi, this is Brice Wilson. Welcome back. In this module, I'm going to talk about module bundlers and how they can replace the module loaders I've been using to load AMD and CommonJS modules in a browser. Module bundlers really solve the same problem as module loaders, but they do it as a build step rather than at runtime. I'll begin by talking about the role module bundlers play and why you might want to use one of them instead of a module loader. I'll then show you where a bundler would fit in a typical development workflow before demonstrating how to use a couple of different bundlers. I'll show you how to quickly install and use a bundler named Browserify to bundle the CommonJS modules in the demo app. After that, I'll show you a couple of ways to use a popular new tool named Webpack. I'll first use it to bundle AMD modules, and then I'll show you how I can take advantage of its extensibility to have it use Babel to transpile ES2015 modules for me before bundling them. Let's get started by talking about what a bundler is and why you might want to use one.