Depending on the ScriptEngine of your choice you have various options to compile a script
The scripts are managesd by the Fulcrum ResourcManager Service. This gives you the locator functionality, optional decryption and location transparency
The locator gives you easy customization of scripts. Let's say you would like to invoke the script 'foo.js' for a customer 'BAR' using the following script layout
scripts -- foo.js -- BAR -- foo.js
In the case of invoking 'foo.js' the script 'foo.js' would be executed. In the case of invoking 'BAR/foo.js' the script 'BAR/foo.js' would be executed. In the case of invoking 'FOO/foo.js' the locator is looking for 'FOO/foo.js'. Since it isn't found it steps up a directory to execute 'foo.js'. The trick was taken from the Fulcrum XSLT service which uses a simlilar fallback mechanism.