From the course: SharePoint Framework for Developers: 1 Understanding the Toolchain

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Introduction and need for webpack

Introduction and need for webpack

From the course: SharePoint Framework for Developers: 1 Understanding the Toolchain

Start my 1-month free trial

Introduction and need for webpack

- Next, let's talk about webpack. What is it and what is the need for it? If you go to webpack.js.org, you'll find things like bundle your assets and on the left hand side, .js, .hbs, a bunch of things, and they get bundled into static assets. Why would we want to do this? Well let's see that through a practical example. In the previous chapter, if you go into exercise files, chapter two, folder seven, pick up the End code there, unzip it, and run npm install. You should have a project setup that looks like this. You should have an index.js. You should have a package.json. We are relying on an old module called Moment. And now, I can go to terminal and simply type node index.js and it seems to work. Now, node index.js, if you go up here, node index.js has a line at the top that says var moment = require('moment') and as I explained in the previous chapter, it dives into the node module's folder and it looks for the definition of this Moment object that we're trying to create. Visual…

Contents