Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Libraries optional import

No security coverage Maintenance fixes only

Part of the Libraries ecosystem · 4 projects

This module allows you to define assets within library definitions that can be optionally included. This is useful for assets that are not always needed and can improve performance by only loading them when necessary.

Allows optional assets in library definitions.

Post-Installation

Add the optional library to the library definition in your module's libraries.yml file as shown below

global:
  version: 1.x
  css:
    theme:
      dist/app.css: { }
      dist/app-optional.css: { optional: true }
  js:
    dist/app.js: { }
    dist/app-optional.js: { optional: true }
  dependencies:
    - core/jquery
    - core/drupal
    - core/drupalSettings
    - core/once
Drupal 10–11 PHP >=8.3

Ask your assistant about Libraries optional import

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Apr 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
1.1.0 Stable 10–11 PHP >=8.3 Apr 23, 2024
1.1.x-dev Dev 10–11 PHP >=8.3 Apr 23, 2024
1.0.0 Stable 10 PHP >=8.1 Apr 23, 2024
1.0.x-dev Dev 10 PHP >=8.1 Apr 23, 2024