function generateRoutes(baseDir, {globOptions, routerOption} = {}) {
    return getDirs(baseDir, '.vue', globOptions)
        .then(dirs => {
            let tree = mapDirsInfo(dirs, baseDir)
                .reduce((tree, info) => appendToTree(tree, info.levels, info), []);
            return treeToRouter(tree[0].children, {dir: basename(baseDir)}, routerOption);
        });
}
generate router by the structure of pages/

@param {string} baseDir root folder path
@param {Object} options generate options
@return {Promise} resolve generated router, reject error