Set weight for JavaScript files loaded via theme.libraries.yml? 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:
    js/foo.js:
    js/bar.js: { weight: N }