webpack

1 min read javascript, bundler, packaging

Written in 2015. Tools, APIs and prices may have changed since.

Lab note What I wrote down while learning this by building with it. Short by design; the code is in pfeilbr/webpack-playground.

A project to learn and experiment with the webpack module bundler.

Development

  1. Start local webpack server

    $ webpack-dev-server --progress --colors --debug
    

    This serves all changes out of memory. Remember to run webpack by itself to persist changes

  2. Open http://localhost:8080/webpack-dev-server/bundle

  3. Make code changes. Changes will live reload.

  4. Persist changes by running

    $ webpack
    

Directory and File Details

public/ - client side files public/lib/index.js - webpacks entry point


react-app.js - react application example

demonstrates the usage of

  • jsx loader
  • css loader
  • es6 support

angular-app.js - angular application example

demonstrates the usage of

  • ng-cache loader for views and partials

Keep learning

Get new guides and courses by email

An occasional email when I publish a new guide, course or post. No spam, and you can unsubscribe any time.

Sent with Buttondown. I never share your address. Prefer a feed? Use the RSS feed.