function resolveRelativePaths(configJson, jsonPath) {
            var dir = path.dirname(jsonPath);
            if (configJson.imports) {
                configJson.imports = _.map(configJson.imports, function(imp) {
                    if (imp[0] === '.' && imp[1] === '/') {
                        return dir + imp.substring(1);
                    } else {
                        return imp;
                    }
                });
            }
            if (configJson.commands) {
                _.each(configJson.commands, function(cmd, name) {
                    if (cmd.scriptUrl && cmd.scriptUrl[0] === '.' && cmd.scriptUrl[1] === '/') {
                        configJson.commands[name].scriptUrl = dir + cmd.scriptUrl.substring(1);
                    }
                });
            }
            if (configJson.modes) {
                _.each(configJson.modes, function(mode) {
                    resolveRelativePaths(mode, jsonPath);
                });
            }
            if (configJson.editor_themes) {
                resolveThemes(configJson.editor_themes);
            }
            if (configJson.window_themes) {
                resolveThemes(configJson.window_themes);
            }
            function resolveThemes(themes) {
                _.each(themes, function(theme) {
                    if (!_.isArray(theme.css)) {
                        theme.css = [theme.css];
                    }
                    theme.css = _.map(theme.css, function(file) {
                        if (file[0] === '.' && file[1] === '/') {
                            return dir + file.substring(1);
                        } else {
                            return file;
                        }
                    });
                });
            }
            return configJson;
        }
This function finds all relative script and import paths
(scriptUrl keys and for imports) and replaces them with
absolute ones