r.js
function setBaseUrl(fileName) {
        //Use the file name's directory as the baseUrl if available.
        dir = fileName.replace(/\\/g, '/');
        if (dir.indexOf('/') !== -1) {
            dir = dir.split('/');
            dir.pop();
            dir = dir.join('/');
            exec("require({baseUrl: '" + dir + "'});");
        }
    }
function setBaseUrl(fileName) {
        //Use the file name's directory as the baseUrl if available.
        dir = fileName.replace(/\\/g, '/');
        if (dir.indexOf('/') !== -1) {
            dir = dir.split('/');
            dir.pop();
            dir = dir.join('/');
            exec("require({baseUrl: '" + dir + "'});");
        }
    }
function setBaseUrl ( fileName ) { //Use the file name's directory as the baseUrl if available. dir = fileName . replace ( / \\ / g , '/' ) ; if ( dir . indexOf ( '/' ) !== - 1 ) { dir = dir . split ( '/' ) ; dir . pop ( ) ; dir = dir . join ( '/' ) ; exec ( "require({baseUrl: '" + dir + "'});" ) ; } }
Sets the default baseUrl for requirejs to be directory of top level
script.
Sets the default baseUrl for requirejs to be directory of top level script .