While the first five parts of the tutorial cover everything from setting up the development environment to finally deploying a unit-tested app, this part will briefly describe how an app that uses system.js for client side module loading can be set up to use webpack. The steps I'll be describing here will work nicely in Visual Studio for a great development experience. This commit covers the required steps for the demo project.
What's a module loader used for?
Why prefer webpack over system.js?
npm dependencies in package.json
Mainly webpack and loaders for different file types are the novelty here. Note that systemjs is still around. I'm using that for the unit tests of my TypeScript code with Chutzpah and found it way simpler and faster to configure than webpack, so I'll still have it as a devDependency.
webpack configuration for your own modules
webpack configuration for dependencies
There's not much to see here. You'll just have to specify all the modules that change not as frequent as your custom code in a separate bundle to save on compilation time and possible bandwidth if you're iterating fast while your app is already in use. Line 28 contains the configuration of the Dll plugin, which itself is referenced by the bundle of your code.
App entry point
Since zone.js and reflect-metadata will no longer be loaded separately from the browser, you'll need to import them at the entry point of your app so they're available. Additionally, I'm using the style-loader to load global CSS into the app. The style loader will insert the content of the file at runtime in the documents <head> section, making it available for the whole app.
Updating your Asp.Net Core view
Finally, you can remove all the single bundles and just include two scripts in your view: vendor.js and main.js. Just make sure to either defer loading them or put them below your <my-app> tag, otherwise you'll get an error from Angular 2 telling you that it can't find the app root element.
Here's how much faster (and smaller!) the example app becomes after using webpack:
Update 28.05.2017: Updated Angular to 4.1.3 and Asp.Net Core to 1.1.2. Switched to Visual Studio 2017 csproj format