This course has been updated! We now recommend you take the AWS for Front-End Engineers (ft. S3, Cloudfront & Route 53) course.
Transcript from the "Browserify" Lesson
>> Kevin Whinnery: I think we'll start off with the two kind of heroes of our front end toolchain which are Browserify and SAS and they help with a lot of different things that make our front end code much more expressive to write. And also also more performant and feature rich.
[00:02:27] You know that there's a switch when you go from one language to the other and Browserify makes that switch pretty much seamless. So a it's a a critical tool in my mind for the success of node.js. So Browserify itself provides one primary service for your application which is t o analyze the dependency structure of your code to see which modules are required.
[00:03:45] And we can actually take that code and convert it to regular ES5 code that can run on a variety of browsers. So the Babelify Transform provides that functionality for us. And that's just one of many different transforms that you can use. There are transforms that allow you to require like templates, so if you have Jade templates or a Pug templates I guess, they're calling it these days.
[00:04:43] Browserify itself doesn't ship with any of these transformations. And while you can execute Browserify directly from the from the command line, typically you can execute it with a variety of options. Typically what ends up being expedient is configuring your Browserify transforms and options within the package.json for the project.
[00:05:38] So in the configuration down below for Browserify Shim, we have the ability to require jquery in our common js style browser code. But that's essentially going to be a reference to the window scoped dollar sign object to which jquery is assigned when actually running in the browser. In addition to the shim transform we also have the Babelify transform which again is a framework for integrating lots of different features for advanced versions of actual script into your application.
[00:06:37] So Browserify, a key tool in our tool chain here.
>> Speaker 2: Where is that configuration file?
>> Kevin Whinnery: That's actually gonna be in package.json, so down near the bottom.