How do I remove a module JavaScript file through a theme?
Implement hook_library_info_alter:

mytheme.theme:

/**
 * Implements hook_library_info_alter().
 */
function mytheme_library_info_alter(&amp;$libraries, $extension) {
  if ($extension === 'some_module') {
    unset($libraries['some_module.library']['js']['js/foo.js']);
  }
}