Webpack Lightening Talk

Webpack

Takes stuff* and makes browser bundles out of it

My experience

Yes it has feature x

  • Module loaders CommonJS (including NPM), AMD, Shims for broken modules
  • Loads HTML templates (Jade etc)
  • Can also bundle CSS

All competency, no hype

Using it

  • in npm
  • webpack generate
  • but really it's all about..

webpack.config.JS

`javascript var path = require("path");

module.exports = { entry: { app: "./src/app.js", }, output: { path: path.join(__dirname, "app"), filename: "[name].bundle.js", chunkFilename: "[id].bundle.js" }, module: { loaders: [ { test: /.json$/, loader: "json" } ] }, resolve: { alias: { stream: "stream-browserify" } } } `

app.js:

`javascript require('./graph.js');

require.ensure([], function(require) { // Require external dependencies here require('./lib/angular/angular.js'); require('./lib/angular-route/angular-route.js');

// Main app code here console.log("I can haz app")

}, 'libs'); `

Read The Docs

http://webpack.github.io/docs/

I'm

Eric Drechsel

Slides at //eric.pdxhub.org/talks

@edrex