Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Webpack - Attack of the JS.

Webpack - Attack of the JS.

Talk I gave at Amura Marketing Technologies, Pune, India. Outlining what Webpack is and how it impacts Ruby on Rails development.

Avatar for Ishan Kanade

Ishan Kanade

March 18, 2017
Tweet

Other Decks in Programming

Transcript

  1. The problem with the script tag - Loads everything in

    the same scope. - Easy for an HTML file to have 100+ script tags loading as many files in it. - Manually handle dependencies by reordering the sequence of loading. - Every Script tag is a trip to the resource for that script file.
  2. Good authors divide their books into chapters and sections; good

    programmers divide their programs into modules.
  3. What is Module Bundling? On a high level, module bundling

    is simply the process of stitching together a group of modules (and their dependencies) into a single file (or group of files) in the correct order.
  4. When you have one common module pattern Concat. Minify. Uglify.

    That One large JS file you will never read.
  5. Embracing Change: Rails 5.1 Adopts Yarn, Webpack, and the JS

    Ecosystem You can try it now in a Rails 4.2+ app by including the ‘webpacker’ gem in your gemfile, running bundle install and then the follow. “rake webpacker:install”