This project is not covered by Drupal’s security advisory policy.

Component Installer allows installation of Components (third-party JavaScript and CSS packages) through Composer. This module facilitates its use for Drupal.

Dependencies

Usage

  1. Add the Components you want to your module's composer.json file:
    {
        "require": {
            "components/underscore": "*",
            "components/normalize.css": "*"
        }
    }
    
  2. Make your module depend on component_installer in your .info file:
    dependencies[] = component_installer
    
  3. Use Composer Manager to help build and install the Composer dependencies.
  4. The Component's JavaScript is now available for use through require.js:
    require(['underscore'], function (_) {
      // Underscore is now available.
      _.each([1, 2, 3], alert);
    });
    
  5. Any CSS that the Component provides is automatically loaded.

Available Components

See Packagist search for "component" for a list of available Components.

Project information

Releases