How to load JS as the first item in head tag?
Using @Manav's link, i was able to get to this solution that worked. 

function mymodule_page_attachments(&amp;$attachments) {
  $custom_script = [
    '#type' =&gt; 'html_tag',
    '#tag' =&gt; 'script',
    '#attributes' =&gt; [
      'src' =&gt; 'path/to/file.js',
    ],
    '#weight' =&gt; -200, // this allowed me to do what i needed
  ];

  $attachments['#attached']['html_head'][] = [$custom_script, 'custom_script_key'];
}