Varbase Libraries
Varbase 11.0.x manages front-end library dependencies using NPM (or Yarn) in combination with the drupal-libraries-sync tool. This approach provides a modern, standardized workflow for installing and maintaining JavaScript and CSS libraries that Drupal modules and themes depend on.
Overview
Many Drupal modules require external JavaScript or CSS libraries (such as Slick carousel, Ace editor, or Chart.js) to be present in Drupal's libraries/ directory. Traditionally, these libraries had to be downloaded and placed manually. Varbase uses drupal-libraries-sync to automate this process by:
Defining library dependencies in
package.jsonas NPM packages.Running
npm install(oryarn install) to download the packages tonode_modules/.Using
drupal-libraries-syncto copy the required files fromnode_modules/to Drupal'slibraries/directory.
This ensures that library versions are tracked, reproducible, and easy to update.
Sections
Detailed guide on configuring package.json, running sync commands, and managing front-end libraries in your Varbase project.
Last updated