How do I change the dependencies of a library from another module
My flot plugin is called timezone_js. I created a file, timezone_js.module and added a call to hook_library_info_alter.

function timezone_js_library_info_alter(&amp;$libraries,$extension){
  //We need to add this module as a dependency of the flot module.
  if ($extension == "flot_d8") {
    $libraries['flot']['dependencies'][] = 'timezone_js/timezone_js';
  }
}