You can create a template file with the standard Template Name header and serve that as a JS file in PHP by altering the header(“Content-type: text/javascript”);
Downfall — you won’t be able to use register/enqueue scripts. But you can probably write a hook to load your PHP-fake js file after enqueue scripts occur