Leveraging the Libraries API: A Crash Course on Modular Javascript

Joe Karasek

Drupal's Libraries API is a powerful tool that lets developers attach javascript to webpages in an intelligent manner. When paired with modular javascript and code splitting through Webpack, the Libraries API can be leveraged to improve site performance by loading only the RIGHT assets in the RIGHT places.

So next time marketing asks you to bring back that bloated jQuery carousel, it wont slow down the performance of the entire site.

This presentation will teach you how to:

  • write modular javascript in the context of a Drupal 8 theme

  • set up Webpack to take advantage of tree shaking and code splitting

  • use the Attach Libraries API to inject javascript in a reliable and performant way

Program tags

front end development, javascript, performance

Experience Level

Intermediate

Drupal Version