Say I have the following structure for 3 different apps that live on 3 different domains, and a personal "cdn" where I can put files that are common across all three apps:
root/
/dinosaureggs.com
/magicalapples.com
/wizardsupplies.com
/mypersonalcdn.com
/js
/php
/css
This same structure is mirrored on a local and production environment.
If I'm in dinosaureggs.com and I want to use a shared PHP library in the /php folder I can say:
require('/../mypersonalcdn.com/php/library.php')
This works fine on both the local and production servers.
However, it won't work for JS because JS includes can't back out of the "app" with paths the same way PHP can.
I can't say:
<script type="text/javascript" src="/../mypersonal.cdn/js/library.js"></script>
Now, on live I could say:
<script type="text/javascript" src="http://mypersonalcdn.com/js/menus.js"></script>
But this doesn't solve my problem for local environment (at least to the extent that I wish to leave it truly locally and have the option to develop offline).
Any suggestions?