I'm using this to preload/ defer css but is there a way to also do similar with javascipt files, I've looked everywhere I can think of but not found it, maybe I'm doing the wrong searches:
<link rel="preload" href="https://cdnjs.cloudflare.com/ajax/libs/video.js/8.2.0/video-js.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'" integrity="sha512-akMT+LKE5CNd8NbHp0x0u6CoUJDZSMBFd5iunyEJReywcV9G10IJdNyCgxK+pnhDpnqsaPQsO3x7mnZZAs0CUA==" crossorigin="anonymous" referrerpolicy="no-referrer" > <noscript><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/video.js/8.2.0/video-js.min.css" integrity="sha512-akMT+LKE5CNd8NbHp0x0u6CoUJDZSMBFd5iunyEJReywcV9G10IJdNyCgxK+pnhDpnqsaPQsO3x7mnZZAs0CUA==" crossorigin="anonymous" referrerpolicy="no-referrer" ></noscript>
<link rel="preload" as="script" href="critical.js">asvalue and it is preloaded intentionally.