code: 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 + "'});");
          }
      }
docs: Sets the default baseUrl for requirejs to be directory of top level
  script.