generateRoutesContent(routes) {
        const generate = routes => routes.map(cur => {
            // Call `this.$router.replace({name: xxx})` when path of 'xxx' contains '*' will throw error
            // see https://github.com/vuejs/vue-router/issues/724
            // Solution: write a normal path and add alias with '*'
            let route = {
                path: cur.rewritePath,
                component: `_${cur.hash}`,
                meta: cur.meta || {}
            };

            if (cur.name) {
                route.name = cur.name;
            }

            if (cur.alias) {
                route.alias = cur.alias;
            }

            if (cur.redirect) {
                route.redirect = cur.redirect;
            }

            if (cur.children) {
                route.children = generate(cur.children);
            }

            return route;
        });

        return JSON.stringify(generate(routes), undefined, 4)
            .replace(/"component": "(_.+)"/mg, '"component": $1');
    }
generate routes content which will be injected into routes.js
based on nested routes

@param {Array} routes route list
@return {string} content