Chapter 7Bundling

In the beginning, JavaScript was simpler. HTML elements in your markup had attributes with names like onclick, and if you wanted something dynamic to happen, you’d write, like, one line of code in the onclick attribute. Although this was simple, it was extremely limited. Eventually coders wanted more complex effects in the browser and started placing JavaScript code in files external to the HTML and sending them to the browser via the script tag.

This was still sort of simple but also still sort of limited. As time moved on, JavaScript programs got more and more complicated, and the need to include multiple JavaScript files grew. Tools that compiled code to JavaScript appeared. Dependencies on third-party libraries grew. ...

Get Modern Front-End Development for Rails, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.