Override module javascript file in theme or custom module Is it possible to override a single javascript file from a module within a theme or custom module? My specific use would be for Views/js/ajax_view.js - I've had to apply multiple patches to get ajax views to work properly with BEF and panels, and though I'm including documentation for future developers, it seems more foolproof to override within the theme or a custom module.
hook_js_alter() allows you to modify any JS before it is written to the page.
The documentation includes a snippet to replace a core file with an alternate from a module:

function hook_js_alter(&amp;$javascript) {
  // Swap out jQuery to use an updated version of the library.
  $javascript['misc/jquery.js']['data'] = drupal_get_path('module', 'jquery_update') . '/jquery.js';
}