Logo
Logo

Dependencies API

Breakdance allows you to modify dependencies using various hooks and filters. This may be useful for hosting files locally or changing the version of a dependency.

Append Dependencies Filter

The breakdance_append_dependencies filter can be used to modify or remove dependencies. Information on this filter may be found here: https://github.com/soflyy/breakdance-developer-docs/blob/master/hooks/other.md.

Reusable Dependencies

You can use the breakdance_reusable_dependencies_urls action to change the version or path of a reusable dependency in Breakdance. This is useful for adding new dependencies or converting some dependencies to be local only. More information about this action may be found here:  https://github.com/soflyy/breakdance-developer-docs/blob/master/reusable-dependencies/readme.md.

Example: Replacing GSAP Dependencies

The following example shows how to replace GSAP Dependencies:

  1. Download GSAP: https://gsap.com/docs/v3/Installation.
  2. Unzip the folder
  3. Go to gsap-public and upload the “gsap.min.js” and “ScrollTrigger.min.js” files to your server. For example, you can upload it to “/wp-content/uploads/local.
  4. Add the following code to your site using your preferred code snippets plugin: