I need to use in my theme a js file used originally by a other module: View slideshow.

View Slideshow take the jquery plugin Cycle from the libraries folder, on the root of the App, something like


Now i need to use the jquery plugin Cycle in my theme, but drupal put it after my main theme js file

<script src=mytheme.js>  
<script src=....cycle.js>  

So it can't use it, because cycle must be before.

I add the file in my libraries.yml file like this:

  js :
    - ...cycle.js: {}
    - mytheme.js: {}

but cycle steel remain after. How could i move Cycle on top ?


Okay this was easy... I realise that the js file is in the library views_slideshow_cycle/jquery_cycle, created by the module.

So i just have to add it has a dependencies to my theme

   dependencies : 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.