Webpack 2
Webpack 2 (Single License)
$5.00
Minimum price
$9.99
Suggested price
Webpack 2

This book is 99% complete

Last updated on 2017-05-17

About the Book

In Webpack 2 - A Build Tool for Modern JavaScript Applications we start by creating a sample application containing some of the most common features of a web application, and then use Webpack to serve, cache and optimize the project assets. Each chapter works as a reference for a different topic, meaning the book can be read just as well in or out of order.

Amongst other things, in this guide we'll go through:

  • The difference between module bundlers and task runners
  • How to install Webpack and create our first configuration file
  • How to use the Webpack Dev Server to serve, watch and refresh only the parts of the application that change without having to do a full page reload
  • How to install Babel to be able to utilize ES6 functionality
  • How to use Source Maps to aid in debugging
  • How to split code into smaller bundles and lazy load them only when they're needed
  • How to utilize tree shaking to remove any code that our project doesn't use
  • How to create environment specific configuration so that we can harness the full power of Webpack in both our development and production environments

Although this guide is a complete guide for Webpack that goes from creating a basic configuration all the way to splitting configuration based on unique environment requirements, it is regularly updated with bonus chapters containing tutorials on new and interesting features and plugins as they come out. Some exciting chapters already in the works are:

  • Loading and transpiling TypeScript files
  • Loading and transpiling SASS/LESS stylesheets
  • Creating and running tests with Karma
  • Automatically linting code with JSLint
  • Supporting multiple languages using internationalization
  • Autoprefixing and removing unused styles in CSS
  • Utilizing Web Workers
  • Automatically installing NPM packages simply by requiring them in your code

About the Author

Sha Alibhai
Sha Alibhai

Sha has been a Software Developer for over 18 years with a BSc in Computing from Coventry University in the UK interested predominantly in web and mobile technologies.

Packages

Single License

A single copy of the book and all future updates. Includes full access to all code samples.

Includes:

  • extras
    Code samples

    Code samples for all chapters

  • English

  • PDF

  • EPUB

  • MOBI

  • WEB

$5.00
Minimum price
$9.99
Suggested price
One for your Friend

Buy two copies, one for yourself and one for a friend. Includes full access to all code samples and free updates for life.

Includes:

  • extras
    Code samples

    Code samples for all chapters

  • English

  • PDF

  • EPUB

  • MOBI

  • WEB

$9.99
Minimum price
$16.99
Suggested price
Team License

5 licenses to share between yourself and your team mates! Includes code samples and access to all future updates.

Includes:

  • extras
    Code samples

    Code samples for all chapters

  • English

  • PDF

  • EPUB

  • MOBI

  • WEB

$24.99
Minimum price
$39.99
Suggested price

Table of Contents

  • Book Revision
  • Get Notified of Updates via Twitter
  • Conventions Used in This Book
  • Module Bundlers vs Task Runners
    • Task Runners
    • Module Bundlers
    • Webpack
  • Installation and Basic Use
    • Creating a Project
    • Running Webpack from the Command Line
    • Serving the Project
  • Creating a Webpack Config File
    • Running Webpack via NPM Scripts
  • Serve, Watch and Hot Module Replacement
    • Module Watchers
    • Live Reload
    • Hot Module Replacement (HMR)
    • Creating a Server with Node
  • Using Babel to Transpile your Code
    • Installing Babel
    • Add a .babelrc file
    • Adding Module Loaders to Webpack Config
    • webpack.config.js
    • Testing ES6 features
  • Adding Source Maps
    • Comparing Source Maps
    • Adding a Source Map
  • Bundling Images, Stylesheets, HTML Templates and Static Assets
    • Loading Assets with file-loader
    • Using url-loader to Encode Assets
    • Loading CSS with style-loader and css-loader
    • Using ExtractTextPlugin to Create an External Stylesheet
    • Loading HTML Templates with html-loader
    • Bundling Static Assets with copy-webpack-plugin
  • Exposing Libraries on the Global Scope
  • Bundle and Code Splitting
    • Bundle Splitting
    • Code Splitting
    • Viewing the Contents of Bundles with webpack-bundle-analyzer
  • Tree Shaking and Minifying your Bundle
    • Testing Tree Shaking
    • Tree Shaking with Babel
    • Minifying the Distribution Bundle
    • Minifying Javascript
    • Minifying CSS
  • Creating Different Environments
    • Webpack Merge
    • Splitting the Configuration
    • Setting the Environment
    • Loading Environment Specific Settings
    • Default Settings - webpack.default.js
    • Development Environment Settings - environment.dev.js
    • Production Enviroment Settings - environment.production.js
    • Environment Specific Code
    • Running Webpack for Different Environments
  • What Next?
    • Support Webpack
    • Twitter Influencers
    • Webpack Tools
    • Further Reading
    • Videos
    • Courses
    • Webpack Examples
    • Angular Resources
    • React Resources
    • Framework Agnostic Resources

Authors have earned$9,206,032writing, publishing and selling on Leanpub,
earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub