Im loading a JavaScript file via my theme's libraries.yml file. How can I change the weight of this file?

I need the file to load before the core and module's JavaScript files. If I set header: true then this happens, but I still want to load the file at the bottom of the page.


You need to try this with in libraries.yml file

    js/bar.js: { weight: N }
  • Note the the value must be in quotes. – Evanss May 25 '16 at 12:49
  • no need of quotes. Try without it. – vgoradiya May 25 '16 at 12:53

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.